summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2016-09-23 14:06:52 +0300
committerAdam Jackson <ajax@redhat.com>2016-09-28 14:53:39 -0400
commit220d327ee00ec1278d50d4ba8cd20612e8b77c8f (patch)
tree7c71e787d427e01cd16e531f5d51138c08ce46e4 /Xext
parent3abf791ab82cb3dc7eacd0317fe0262a71340753 (diff)
Xext: Fix a memory leak
Based on: https://patchwork.freedesktop.org/patch/85636/ Rewritten to also free the resources allocated by panoramix_setup_ids(). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Emi Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'Xext')
-rw-r--r--Xext/shm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Xext/shm.c b/Xext/shm.c
index 125000f5f..1b622e353 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -991,7 +991,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
RT_PIXMAP, pMap, RT_NONE, NULL, DixCreateAccess);
if (result != Success) {
pDraw->pScreen->DestroyPixmap(pMap);
- return result;
+ break;
}
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);
shmdesc->refcnt++;
@@ -1008,7 +1008,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
}
}
- if (result == BadAlloc) {
+ if (result != Success) {
while (j--)
FreeResource(newPix->info[j].id, RT_NONE);
free(newPix);