About: msxml3: Partially implement ::setAttributeNode()
Hello, In proposed patch msxml3: Partially implement ::setAttributeNode() I think I found a little possible memory leak: + name = xmlChar_from_wchar(nameW); + value = xmlChar_from_wchar(V_BSTR(&valueW)); + + if (!name || !value) + { + SysFreeString(nameW); + VariantClear(&valueW); + return E_OUTOFMEMORY; + } Wouldn't you need to free memory allocated for both name and value, in case one of the allocations succeeded ? HTH, Joris
On 10/18/2010 18:21, Joris Huizer wrote:
Hello,
In proposed patch msxml3: Partially implement ::setAttributeNode() I think I found a little possible memory leak:
+ name = xmlChar_from_wchar(nameW); + value = xmlChar_from_wchar(V_BSTR(&valueW)); + + if (!name || !value) + { + SysFreeString(nameW); + VariantClear(&valueW); + return E_OUTOFMEMORY; + }
Wouldn't you need to free memory allocated for both name and value, in case one of the allocations succeeded ? Yes, I already spotted this, will resend whole set anyway. HTH, Joris
participants (2)
-
Joris Huizer -
Nikolay Sivov