[Mesa-dev] [PATCH 4/6] nv30: Fix memory leak.

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


Fixes resource leak defect reported by Coverity.

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

diff --git a/src/gallium/drivers/nv30/nv30_vbo.c b/src/gallium/drivers/nv30/nv30_vbo.c
index 128457f..d7a774f 100644
--- a/src/gallium/drivers/nv30/nv30_vbo.c
+++ b/src/gallium/drivers/nv30/nv30_vbo.c
@@ -278,6 +278,7 @@ nv30_vertex_state_create(struct pipe_context *pipe, unsigned num_elements,
             case 4: fmt = PIPE_FORMAT_R32G32B32A32_FLOAT; break;
             default:
                 assert(0);
+                FREE(so);
                 return NULL;
             }
             so->element[i].state = nv30_vtxfmt(pipe->screen, fmt)->hw;
-- 
1.8.0



More information about the mesa-dev mailing list