glxproxy: Fix memory leak on error path in CreateGLXPixmap (#50281) (v2)

v2: Fix another path spotted by keithp

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Adam Jackson 2014-04-30 13:49:06 -04:00 committed by Keith Packard
parent dff1f5e1a9
commit d9e99edd4d

View File

@ -2009,6 +2009,7 @@ CreateGLXPixmap(__GLXclientState * cl,
}
else {
client->errorValue = (visual ? visual : fbconfigId);
free(pGlxPixmap->be_xids);
free(pGlxPixmap);
return BadValue;
}
@ -2017,6 +2018,7 @@ CreateGLXPixmap(__GLXclientState * cl,
}
if (!(AddResource(glxpixmapId, __glXPixmapRes, pGlxPixmap))) {
free(pGlxPixmap->be_xids);
free(pGlxPixmap);
return BadAlloc;
}