From: Ilia Mirkin Date: Sun, 12 Jan 2014 03:03:19 +0000 (-0500) Subject: nv50: don't leak heap on tls alloc failure X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3f264e16e29a870b4b3b605590c718c35bb1a91c;p=mesa.git nv50: don't leak heap on tls alloc failure Signed-off-by: Ilia Mirkin --- diff --git a/src/gallium/drivers/nouveau/nv50/nv50_program.c b/src/gallium/drivers/nouveau/nv50/nv50_program.c index 73df71c61e2..97857d7989f 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_program.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_program.c @@ -405,8 +405,10 @@ nv50_program_upload_code(struct nv50_context *nv50, struct nv50_program *prog) prog->code_base = prog->mem->start; ret = nv50_tls_realloc(nv50->screen, prog->tls_space); - if (ret < 0) + if (ret < 0) { + nouveau_heap_free(&prog->mem); return FALSE; + } if (ret > 0) nv50->state.new_tls_space = TRUE;