зеркало из https://github.com/mozilla/pjs.git
Fix XRemoteClient leaks. Bug 295173, patch by Ferdinand
<ferdinandw+bmo@gmail.com>, r=caillon
This commit is contained in:
Родитель
3f5fc3fcdc
Коммит
ecd72d8bbe
|
@ -262,8 +262,10 @@ XRemoteClient::CheckWindow(Window aWindow)
|
||||||
0, 0, False, AnyPropertyType,
|
0, 0, False, AnyPropertyType,
|
||||||
&type, &format, &nitems, &bytesafter, &data);
|
&type, &format, &nitems, &bytesafter, &data);
|
||||||
|
|
||||||
if (type)
|
if (type) {
|
||||||
|
XFree(data);
|
||||||
return aWindow;
|
return aWindow;
|
||||||
|
}
|
||||||
|
|
||||||
// didn't find it here so check the children of this window
|
// didn't find it here so check the children of this window
|
||||||
innerWindow = CheckChildren(aWindow);
|
innerWindow = CheckChildren(aWindow);
|
||||||
|
@ -297,8 +299,10 @@ XRemoteClient::CheckChildren(Window aWindow)
|
||||||
XGetWindowProperty(mDisplay, children[i], mMozWMStateAtom,
|
XGetWindowProperty(mDisplay, children[i], mMozWMStateAtom,
|
||||||
0, 0, False, AnyPropertyType, &type, &format,
|
0, 0, False, AnyPropertyType, &type, &format,
|
||||||
&nitems, &after, &data);
|
&nitems, &after, &data);
|
||||||
if (type)
|
if (type) {
|
||||||
|
XFree(data);
|
||||||
retval = children[i];
|
retval = children[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise recurse into the list
|
// otherwise recurse into the list
|
||||||
|
@ -582,6 +586,9 @@ XRemoteClient::FindBestWindow(const char *aProgram, const char *aUsername,
|
||||||
bestWindow = w;
|
bestWindow = w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (kids)
|
||||||
|
XFree((char *) kids);
|
||||||
|
|
||||||
return bestWindow;
|
return bestWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче