From: Vinson Lee Date: Sun, 22 Nov 2009 06:45:53 +0000 (-0500) Subject: glu: Fix memory leak in __gl_meshMakeEdge. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d3b4c99c703f70a9d0e715a97e52672f7f8fc980;p=mesa.git glu: Fix memory leak in __gl_meshMakeEdge. --- 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 );