[Mesa-dev] [PATCH 1/6] swrast: Fix memory leak.

Vinson Lee vlee at freedesktop.org
Thu Jan 31 23:50:30 PST 2013


Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 src/mesa/drivers/dri/swrast/swrast.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
index 9638271..b380de3 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -363,6 +363,7 @@ swrast_new_renderbuffer(const struct gl_config *visual, __DRIdrawable *dPriv,
 	xrb->bpp = 8;
 	break;
     default:
+	free(xrb);
 	return NULL;
     }
 
-- 
1.8.0



More information about the mesa-dev mailing list