From 71cff63c06a6b494dc8921270535f33fb78bd32b Mon Sep 17 00:00:00 2001 From: Adam Richter Date: Wed, 1 May 2019 15:22:15 -0700 Subject: [PATCH] hw/dmx/glxProxy/glxcmds.c CreateContext(): free glxc->real_ids and glxc in a couple of error branches, per complaints from cppcheck. --- hw/dmx/glxProxy/glxcmds.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c index 330d5c4ad..6e64811ce 100644 --- a/hw/dmx/glxProxy/glxcmds.c +++ b/hw/dmx/glxProxy/glxcmds.c @@ -285,10 +285,13 @@ CreateContext(__GLXclientState * cl, num_be_screens = to_screen - from_screen + 1; glxc->real_ids = xallocarray(num_be_screens, sizeof(XID)); if (!glxc->real_ids) { + free(glxc); return BadAlloc; } glxc->real_vids = xallocarray(num_be_screens, sizeof(XID)); if (!glxc->real_vids) { + free(glxc->real_ids); + free(glxc); return BadAlloc; }