glslcompiler: Fix memory leaks on error paths.
authorVinson Lee <vlee@vmware.com>
Fri, 9 Jul 2010 23:20:32 +0000 (16:20 -0700)
committerVinson Lee <vlee@vmware.com>
Fri, 9 Jul 2010 23:20:32 +0000 (16:20 -0700)
src/mesa/drivers/glslcompiler/glslcompiler.c

index d002300e0922355e5ded0af9b6c2c7545874356f..4211e69ff9b21a607e15a553424abd6bfa6c61fd 100644 (file)
@@ -125,6 +125,7 @@ CreateContext(void)
          _mesa_destroy_visual(vis);
       if (buf)
          _mesa_destroy_framebuffer(buf);
+      free(cc);
       return GL_FALSE;
    }
 
@@ -142,6 +143,7 @@ CreateContext(void)
        !_tnl_CreateContext( ctx ) ||
        !_swsetup_CreateContext( ctx )) {
       _mesa_destroy_visual(vis);
+      _mesa_destroy_framebuffer(buf);
       _mesa_free_context_data(ctx);
       free(cc);
       return GL_FALSE;