Mesa (mesa_7_6_branch): glu: Fix memory leak in __gl_meshMakeEdge.

Vinson Lee vlee at kemper.freedesktop.org
Fri Dec 4 00:08:05 PST 2009


Module: Mesa
Branch: mesa_7_6_branch
Commit: d23bb22f6258a4b55af42fdb3f29fec2e694df72
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d23bb22f6258a4b55af42fdb3f29fec2e694df72

Author: Vinson Lee <vlee at vmware.com>
Date:   Sun Nov 22 01:45:53 2009 -0500

glu: Fix memory leak in __gl_meshMakeEdge.
(cherry picked from commit d3b4c99c703f70a9d0e715a97e52672f7f8fc980)

---

 src/glu/sgi/libtess/mesh.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/glu/sgi/libtess/mesh.c b/src/glu/sgi/libtess/mesh.c
index ae861f8..95f87cd 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 );



More information about the mesa-commit mailing list