mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1187410 - Use GetNameShared() in XPCNativeInterface::NewInstance() to avoid a leak. r=mrbkap
GetName() returns a new string, but that string is never freed. This patch avoids the leak by not copying the string. This is okay because the scope of intfNameChars is within the scope of aInfo.
This commit is contained in:
parent
2ee305ed5c
commit
c44d10db45
@ -239,8 +239,8 @@ XPCNativeInterface::NewInstance(nsIInterfaceInfo* aInfo)
|
||||
if (mainProcessScriptableOnly && !XRE_IsParentProcess()) {
|
||||
nsCOMPtr<nsIConsoleService> console(do_GetService(NS_CONSOLESERVICE_CONTRACTID));
|
||||
if (console) {
|
||||
char* intfNameChars;
|
||||
aInfo->GetName(&intfNameChars);
|
||||
const char* intfNameChars;
|
||||
aInfo->GetNameShared(&intfNameChars);
|
||||
nsPrintfCString errorMsg("Use of %s in content process is deprecated.", intfNameChars);
|
||||
|
||||
nsAutoString filename;
|
||||
|
Loading…
Reference in New Issue
Block a user