diff options
author | Russell King <rmk@arm.linux.org.uk> | 2015-05-30 16:27:14 +0100 |
---|---|---|
committer | Russell King <rmk@arm.linux.org.uk> | 2015-06-29 12:58:32 +0100 |
commit | 9fa361db01cc18f61055d4324266805cc9727c49 (patch) | |
tree | e28c28b2c2381afb1e202d94d96d6c0e20bd58e8 | |
parent | 53a9bccbd871290d5d9880a6744225ea36eb29af (diff) |
etnaviv: fix memory leak in etnaviv_accel_Glyphs()
We were not freeing the array of glyphs to be drawn. Add the missing
free()s.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r-- | etnaviv/etnaviv_accel.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/etnaviv/etnaviv_accel.c b/etnaviv/etnaviv_accel.c index 8894e8d..53a584d 100644 --- a/etnaviv/etnaviv_accel.c +++ b/etnaviv/etnaviv_accel.c @@ -1946,10 +1946,8 @@ Bool etnaviv_accel_Glyphs(CARD8 final_op, PicturePtr pSrc, PicturePtr pDst, pMaskPixmap = pScreen->CreatePixmap(pScreen, width, height, maskFormat->depth, CREATE_PIXMAP_USAGE_GPU); - if (!pMaskPixmap) { - free(gr); - return FALSE; - } + if (!pMaskPixmap) + goto destroy_gr; alpha = NeedsComponent(maskFormat->format); pMask = CreatePicture(0, &pMaskPixmap->drawable, maskFormat, @@ -2000,6 +1998,8 @@ Bool etnaviv_accel_Glyphs(CARD8 final_op, PicturePtr pSrc, PicturePtr pDst, grp->width, grp->height); } + free(gr); + x = extents.x1; y = extents.y1; @@ -2020,10 +2020,12 @@ Bool etnaviv_accel_Glyphs(CARD8 final_op, PicturePtr pSrc, PicturePtr pDst, destroy_picture: FreePicture(pMask, 0); + free(gr); return FALSE; destroy_pixmap: pScreen->DestroyPixmap(pMaskPixmap); +destroy_gr: free(gr); return FALSE; } |