Fix XRemoteClient leaks. Bug 295173, patch by Ferdinand

<ferdinandw+bmo@gmail.com>, r=caillon
This commit is contained in:
bzbarsky%mit.edu 2005-08-19 15:15:34 +00:00
Родитель 2273edc3a7
Коммит 7d705097f5
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -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;
}