summaryrefslogtreecommitdiff
path: root/src/glu/sgi/libutil/mipmap.c
diff options
context:
space:
mode:
authorMaciej Cencora <m.cencora@gmail.com>2009-11-23 22:14:48 +0100
committerMaciej Cencora <m.cencora@gmail.com>2009-11-23 22:14:48 +0100
commit5173d14cb5821637f22247d16be1b970f3762d6a (patch)
treee93826ec799fdbe513592e253278545e2584a7bf /src/glu/sgi/libutil/mipmap.c
parent18384af7491c408c4182b72807b02c11b55509f8 (diff)
parent960464e42dce138fde11c379ce7744bc4be14aa2 (diff)
Merge commit 'origin/mesa_7_7_branch'
Diffstat (limited to 'src/glu/sgi/libutil/mipmap.c')
-rw-r--r--src/glu/sgi/libutil/mipmap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c
index af647af73c..c5faebd6a3 100644
--- a/src/glu/sgi/libutil/mipmap.c
+++ b/src/glu/sgi/libutil/mipmap.c
@@ -3526,6 +3526,8 @@ gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin,
afterImage =
malloc(image_size(widthout, heightout, format, GL_UNSIGNED_SHORT));
if (beforeImage == NULL || afterImage == NULL) {
+ free(beforeImage);
+ free(afterImage);
return GLU_OUT_OF_MEMORY;
}
@@ -3760,6 +3762,7 @@ static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat,
glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels);
glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ free(newImage);
return GLU_OUT_OF_MEMORY;
}
}
@@ -7382,6 +7385,8 @@ int gluScaleImage3D(GLenum format,
afterImage = malloc(imageSize3D(widthOut, heightOut, depthOut, format,
GL_UNSIGNED_SHORT));
if (beforeImage == NULL || afterImage == NULL) {
+ free(beforeImage);
+ free(afterImage);
return GLU_OUT_OF_MEMORY;
}
retrieveStoreModes3D(&psm);