Changes: Fixes for Coverity tool findings

RevBy: Juha Lintula
pull/1/head
Alexey Shilov 14 years ago
parent 05ba6b95ac
commit e7b24a3e76

@ -44,7 +44,8 @@ MDeclarativeCachePrivate::MDeclarativeCachePrivate() :
initialArgv(new char* [initialArgc]),
appDirPath(QString()),
appFilePath(QString()),
cachePopulated(false)
cachePopulated(false),
testabilityInterface(0)
{
}

@ -219,8 +219,6 @@ Window windowIdForBinary(Display *dpy, const char *binaryName)
unsigned long nItems = 0;
unsigned long bytesAfter;
unsigned char *prop = 0;
char **wmCommand = NULL;
int wmCommandCount = 0;
// Get the client list of the root window
int status = XGetWindowProperty(dpy, XDefaultRootWindow(dpy), netClientListAtom,
@ -232,17 +230,22 @@ Window windowIdForBinary(Display *dpy, const char *binaryName)
Window * clients = reinterpret_cast<Window *>(prop);
for (unsigned long i = 0; i < nItems; i++)
{
char **wmCommand = NULL;
int wmCommandCount = 0;
if (binaryNameForPid(windowPid(dpy, clients[i])) == binaryName ||
(XGetCommand (dpy, clients[i], &wmCommand, &wmCommandCount) != 0 &&
wmCommandCount > 0 && strcmp(wmCommand[0], binaryName) == 0))
{
retValue = clients[i];
break;
}
if (wmCommand) {
XFreeStringList(wmCommand);
}
if (retValue)
break;
}
XFree(prop);

Loading…
Cancel
Save