pp: Fix memory leak on error path.
authorVinson Lee <vlee@vmware.com>
Mon, 24 Oct 2011 21:45:39 +0000 (14:45 -0700)
committerVinson Lee <vlee@vmware.com>
Tue, 25 Oct 2011 14:38:53 +0000 (07:38 -0700)
Fixes Coverity resource leak defect.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/postprocess/pp_program.c

index c287af5cf0033bd75cc9d0c0fc5d0c863f0199eb..1a8a584b5158c2a281cc353b1f2897e5157eb005 100644 (file)
@@ -41,12 +41,13 @@ struct program *
 pp_init_prog(struct pp_queue_t *ppq, struct pipe_screen *pscreen)
 {
 
-   struct program *p = CALLOC(1, sizeof(struct program));
+   struct program *p;
 
    pp_debug("Initializing program\n");
    if (!pscreen)
       return NULL;
 
+   p = CALLOC(1, sizeof(struct program));
    if (!p)
       return NULL;