mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Fix XRemoteClient leaks. Bug 295173, patch by Ferdinand
<ferdinandw+bmo@gmail.com>, r=caillon
This commit is contained in:
parent
2273edc3a7
commit
7d705097f5
@ -262,8 +262,10 @@ XRemoteClient::CheckWindow(Window aWindow)
|
||||
0, 0, False, AnyPropertyType,
|
||||
&type, &format, &nitems, &bytesafter, &data);
|
||||
|
||||
if (type)
|
||||
if (type) {
|
||||
XFree(data);
|
||||
return aWindow;
|
||||
}
|
||||
|
||||
// didn't find it here so check the children of this window
|
||||
innerWindow = CheckChildren(aWindow);
|
||||
@ -297,8 +299,10 @@ XRemoteClient::CheckChildren(Window aWindow)
|
||||
XGetWindowProperty(mDisplay, children[i], mMozWMStateAtom,
|
||||
0, 0, False, AnyPropertyType, &type, &format,
|
||||
&nitems, &after, &data);
|
||||
if (type)
|
||||
if (type) {
|
||||
XFree(data);
|
||||
retval = children[i];
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise recurse into the list
|
||||
@ -582,6 +586,9 @@ XRemoteClient::FindBestWindow(const char *aProgram, const char *aUsername,
|
||||
bestWindow = w;
|
||||
}
|
||||
|
||||
if (kids)
|
||||
XFree((char *) kids);
|
||||
|
||||
return bestWindow;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user