hw/dmx/glxProxy/glxcmds.c CreateContext(): free glxc->real_ids and glxc in a couple of error branches, per complaints from cppcheck.

This commit is contained in:
Adam Richter 2019-05-01 15:22:15 -07:00
parent b6eb8cf03f
commit 71cff63c06

View File

@ -285,10 +285,13 @@ CreateContext(__GLXclientState * cl,
num_be_screens = to_screen - from_screen + 1; num_be_screens = to_screen - from_screen + 1;
glxc->real_ids = xallocarray(num_be_screens, sizeof(XID)); glxc->real_ids = xallocarray(num_be_screens, sizeof(XID));
if (!glxc->real_ids) { if (!glxc->real_ids) {
free(glxc);
return BadAlloc; return BadAlloc;
} }
glxc->real_vids = xallocarray(num_be_screens, sizeof(XID)); glxc->real_vids = xallocarray(num_be_screens, sizeof(XID));
if (!glxc->real_vids) { if (!glxc->real_vids) {
free(glxc->real_ids);
free(glxc);
return BadAlloc; return BadAlloc;
} }