diff options
author | Maciej Cencora <[email protected]> | 2009-11-23 22:14:48 +0100 |
---|---|---|
committer | Maciej Cencora <[email protected]> | 2009-11-23 22:14:48 +0100 |
commit | 5173d14cb5821637f22247d16be1b970f3762d6a (patch) | |
tree | e93826ec799fdbe513592e253278545e2584a7bf /src/glu | |
parent | 18384af7491c408c4182b72807b02c11b55509f8 (diff) | |
parent | 960464e42dce138fde11c379ce7744bc4be14aa2 (diff) |
Merge commit 'origin/mesa_7_7_branch'
Diffstat (limited to 'src/glu')
-rw-r--r-- | src/glu/sgi/libtess/mesh.c | 7 | ||||
-rw-r--r-- | src/glu/sgi/libutil/mipmap.c | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/glu/sgi/libtess/mesh.c b/src/glu/sgi/libtess/mesh.c index ae861f86428..95f87cdc949 100644 --- a/src/glu/sgi/libtess/mesh.c +++ b/src/glu/sgi/libtess/mesh.c @@ -284,7 +284,12 @@ GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh ) } e = MakeEdge( &mesh->eHead ); - if (e == NULL) return NULL; + if (e == NULL) { + memFree(newVertex1); + memFree(newVertex2); + memFree(newFace); + return NULL; + } MakeVertex( newVertex1, e, &mesh->vHead ); MakeVertex( newVertex2, e->Sym, &mesh->vHead ); diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index af647af73c9..c5faebd6a35 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); |