From 721954c334787bbddd8726348a4c95465f89677b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 25 Aug 2010 11:22:55 -0700 Subject: [PATCH] nvfx: Set pointer to NULL after free. Guard against potential use after free. --- src/gallium/drivers/nvfx/nvfx_fragprog.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/nvfx/nvfx_fragprog.c b/src/gallium/drivers/nvfx/nvfx_fragprog.c index 7f6b3f6599e..275672a31fa 100644 --- a/src/gallium/drivers/nvfx/nvfx_fragprog.c +++ b/src/gallium/drivers/nvfx/nvfx_fragprog.c @@ -996,8 +996,10 @@ nvfx_fragprog_prepare(struct nvfx_context* nvfx, struct nvfx_fpc *fpc) return TRUE; out_err: - if (fpc->r_temp) + if (fpc->r_temp) { FREE(fpc->r_temp); + fpc->r_temp = NULL; + } tgsi_parse_free(&p); return FALSE; } -- 2.30.2