From: Vinson Lee Date: Wed, 25 Aug 2010 18:22:55 +0000 (-0700) Subject: nvfx: Set pointer to NULL after free. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=721954c334787bbddd8726348a4c95465f89677b;p=mesa.git nvfx: Set pointer to NULL after free. Guard against potential use after free. --- 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; }