Merge branch 'mesa_7_6_branch'
authorBrian Paul <brianp@vmware.com>
Thu, 29 Oct 2009 00:27:25 +0000 (18:27 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 29 Oct 2009 00:27:25 +0000 (18:27 -0600)
src/mesa/drivers/dri/intel/intel_fbo.c
src/mesa/main/texstore.c

index a0ceec6..f6622c0 100644 (file)
@@ -385,6 +385,7 @@ intel_create_renderbuffer(GLenum intFormat)
    default:
       _mesa_problem(NULL,
                     "Unexpected intFormat in intel_create_renderbuffer");
+      _mesa_free(irb);
       return NULL;
    }
 
index f553a89..7da9e84 100644 (file)
@@ -587,8 +587,12 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims,
    /* unpack and transfer the source image */
    tempImage = (GLchan *) _mesa_malloc(srcWidth * srcHeight * srcDepth
                                        * components * sizeof(GLchan));
-   if (!tempImage)
+   if (!tempImage) {
+      if (freeSrcImage) {
+         _mesa_free((void *) srcAddr);
+      }
       return NULL;
+   }
 
    dst = tempImage;
    for (img = 0; img < srcDepth; img++) {