mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 695138 - Fix inout memory leak in XPConnect tests. r=khuey
This commit is contained in:
parent
25e13ac102
commit
014266f77f
@ -131,6 +131,11 @@ NS_IMETHODIMP nsXPCTestParams::TestString(const char * a, char * *b NS_INOUTPARA
|
||||
nsDependentCString bprime(*b);
|
||||
*_retval = ToNewCString(bprime);
|
||||
*b = ToNewCString(aprime);
|
||||
|
||||
// XPCOM ownership rules dictate that overwritten inout params must be callee-freed.
|
||||
// See https://developer.mozilla.org/en/XPIDL
|
||||
NS_Free(const_cast<char*>(bprime.get()));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -147,6 +152,11 @@ NS_IMETHODIMP nsXPCTestParams::TestWstring(const PRUnichar * a, PRUnichar * *b N
|
||||
nsDependentString bprime(*b);
|
||||
*_retval = ToNewUnicode(bprime);
|
||||
*b = ToNewUnicode(aprime);
|
||||
|
||||
// XPCOM ownership rules dictate that overwritten inout params must be callee-freed.
|
||||
// See https://developer.mozilla.org/en/XPIDL
|
||||
NS_Free(const_cast<PRUnichar*>(bprime.get()));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user