[PATCH] radeon: fix a leak in radeon_vbo_get_bo()

Thomas DeRensis tderensis at gmail.com
Thu Sep 4 18:45:19 PDT 2014


The dma_bo struct was never freed in the error path. Reported by cppcheck.

Signed-off-by: Thomas DeRensis <tderensis at gmail.com>
---
 src/radeon_vbo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/radeon_vbo.c b/src/radeon_vbo.c
index 1924772..6b0d278 100644
--- a/src/radeon_vbo.c
+++ b/src/radeon_vbo.c
@@ -185,6 +185,7 @@ again_alloc:
 
 	if (!dma_bo->bo) {
 	    ErrorF("failure to allocate DMA BO\n");
+	    free(dma_bo);
 	    return NULL;
 	}
 	insert_at_head(&accel_state->bo_reserved, dma_bo);
-- 
2.1.0



More information about the xorg-driver-ati mailing list