nvfx: Set pointer to NULL after free.
authorVinson Lee <vlee@vmware.com>
Wed, 25 Aug 2010 18:22:55 +0000 (11:22 -0700)
committerVinson Lee <vlee@vmware.com>
Wed, 25 Aug 2010 18:22:55 +0000 (11:22 -0700)
Guard against potential use after free.

src/gallium/drivers/nvfx/nvfx_fragprog.c

index 7f6b3f6599e96adcbd37a63bfdbbe90c206e1484..275672a31fac18a6f41d91d63efdbc952eec3430 100644 (file)
@@ -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;
 }