g3dvl: Fix memory leaks on error paths.
authorVinson Lee <vlee@vmware.com>
Fri, 4 Nov 2011 04:10:45 +0000 (21:10 -0700)
committerVinson Lee <vlee@vmware.com>
Sun, 6 Nov 2011 05:09:03 +0000 (22:09 -0700)
Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/vl/vl_mpeg12_decoder.c

index d4b8ae0..2442d78 100644 (file)
@@ -1116,11 +1116,14 @@ vl_create_mpeg12_decoder(struct pipe_context *context,
 
    default:
       assert(0);
+      FREE(dec);
       return NULL;
    }
 
-   if (!format_config)
+   if (!format_config) {
+      FREE(dec);
       return NULL;
+   }
 
    if (!init_zscan(dec, format_config))
       goto error_zscan;