vc4: fix memory leak
authorEric Engestrom <eric@engestrom.ch>
Tue, 12 Jul 2016 22:29:34 +0000 (23:29 +0100)
committerEric Anholt <eric@anholt.net>
Tue, 12 Jul 2016 22:47:12 +0000 (15:47 -0700)
The allocation has succeeded by that point, so it needs to be freed.

CovID: 1358929
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/drivers/vc4/vc4_resource.c

index aabe59352f630eb1d7b9a5413f3872d0361eca53..a07fa3d997994e0b51889c4ef1d72691a4a7d9a2 100644 (file)
@@ -552,7 +552,7 @@ vc4_resource_from_handle(struct pipe_screen *pscreen,
                                 handle->stride,
                                 expected_stride);
                 }
-                return NULL;
+                goto fail;
         }
 
         rsc->tiled = false;