vc4: Fix resource leak in register allocation failure path.
authorMun Gwan-gyeong <elongbug@gmail.com>
Wed, 16 Nov 2016 19:17:39 +0000 (04:17 +0900)
committerEric Anholt <eric@anholt.net>
Thu, 17 Nov 2016 03:45:01 +0000 (19:45 -0800)
CID 1394322

Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com>
src/gallium/drivers/vc4/vc4_register_allocate.c

index 72e453a28098c6916295a9bec0abecf080d32c3f..247467b7a76cb540b6e9b315e0927d479a1e81fc 100644 (file)
@@ -354,6 +354,7 @@ vc4_register_allocate(struct vc4_context *vc4, struct vc4_compile *c)
                          */
                         if (c->fs_threaded) {
                                 c->failed = true;
+                                free(temp_registers);
                                 return NULL;
                         }
 
@@ -383,6 +384,7 @@ vc4_register_allocate(struct vc4_context *vc4, struct vc4_compile *c)
                 }
 
                 c->failed = true;
+                free(temp_registers);
                 return NULL;
         }