[PATCH 2/2] glxproxy: Fix memory leak on error path in CreateGLXPixmap (#50281)
Keith Packard
keithp at keithp.com
Mon Apr 21 22:13:49 PDT 2014
Adam Jackson <ajax at redhat.com> writes:
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
> hw/dmx/glxProxy/glxcmds.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c
> index 964db40..f097906 100644
> --- a/hw/dmx/glxProxy/glxcmds.c
> +++ b/hw/dmx/glxProxy/glxcmds.c
> @@ -2017,6 +2017,7 @@ CreateGLXPixmap(__GLXclientState * cl,
> }
>
> if (!(AddResource(glxpixmapId, __glXPixmapRes, pGlxPixmap))) {
> + free(pGlxPixmap->be_xids);
> free(pGlxPixmap);
> return BadAlloc;
> }
I think you missed a return path about 8 lines before this:
else {
client->errorValue = (visual ? visual : fbconfigId);
free(pGlxPixmap);
return BadValue;
}
XFlush(dpy);
}
if (!(AddResource(glxpixmapId, __glXPixmapRes, pGlxPixmap))) {
free(pGlxPixmap);
return BadAlloc;
}
--
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140421/58a1733f/attachment.sig>
More information about the xorg-devel
mailing list