From 3f264e16e29a870b4b3b605590c718c35bb1a91c Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Sat, 11 Jan 2014 22:03:19 -0500 Subject: [PATCH] nv50: don't leak heap on tls alloc failure Signed-off-by: Ilia Mirkin --- src/gallium/drivers/nouveau/nv50/nv50_program.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.30.2