XQuartz: Avoid passing uninitialized pointers to X11ApplicationSetWindowMenu...

XQuartz: Avoid passing uninitialized pointers to X11ApplicationSetWindowMenu in AppleWMSetWindowMenu
Signed-off-by: Jeremy Huddleston Sequoia's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
parent 3bc608a3
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment