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 d002300..4211e69 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;