From: Vinson Lee Date: Mon, 24 Oct 2011 21:45:39 +0000 (-0700) Subject: pp: Fix memory leak on error path. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ca1b60057aaf7f10f9cdbdbcd75cf3f53c751d64;p=mesa.git pp: Fix memory leak on error path. Fixes Coverity resource leak defect. Reviewed-by: José Fonseca --- diff --git a/src/gallium/auxiliary/postprocess/pp_program.c b/src/gallium/auxiliary/postprocess/pp_program.c index c287af5cf00..1a8a584b515 100644 --- a/src/gallium/auxiliary/postprocess/pp_program.c +++ b/src/gallium/auxiliary/postprocess/pp_program.c @@ -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;