XQuartz: Avoid passing uninitialized pointers to X11ApplicationSetWindowMenu in AppleWMSetWindowMenu

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
This commit is contained in:
Jeremy Huddleston Sequoia 2014-01-01 11:10:41 -08:00
parent 3bc608a361
commit 77df653ae3

View File

@ -398,6 +398,15 @@ ProcAppleWMSetWindowMenu(register ClientPtr client)
break;
}
}
/* Check if we bailed out of the above loop due to a request that was too long */
if (j < nitems) {
free(items);
free(shortcuts);
return BadRequest;
}
X11ApplicationSetWindowMenu(nitems, items, shortcuts);
free(items);
free(shortcuts);