vc4: Fix resource leak in register allocation failure path.

CID 1394322

Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com>
This commit is contained in:
Mun Gwan-gyeong 2016-11-17 04:17:39 +09:00 committed by Eric Anholt
parent 686dad657f
commit 20c1623a11
1 changed files with 2 additions and 0 deletions

View 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;
}