cvs: gd(GD_2_0) /libgd gd.c

[email protected] ("Nuno Lopes") Sun, 17 Jun 2007 19:02:59 -0000
Newsgroups php.gd.cvs
Message-ID <cvsnlopess1182106979@cvsserver>
nlopess		Sun Jun 17 19:02:59 2007 UTC

  Modified files:              (Branch: GD_2_0)
    /gd/libgd	gd.c 
  Log:
  now plug the memleak I introduced (because it wont crash)
  
http://cvs.php.net/viewvc.cgi/gd/libgd/gd.c?r1=1.49.2.14&r2=1.49.2.15&diff_format=u
Index: gd/libgd/gd.c
diff -u gd/libgd/gd.c:1.49.2.14 gd/libgd/gd.c:1.49.2.15
--- gd/libgd/gd.c:1.49.2.14	Sun Jun 17 18:49:57 2007
+++ gd/libgd/gd.c	Sun Jun 17 19:02:59 2007
@@ -1,4 +1,4 @@
-/* $Id: gd.c,v 1.49.2.14 2007/06/17 18:49:57 nlopess Exp $ */
+/* $Id: gd.c,v 1.49.2.15 2007/06/17 19:02:59 nlopess Exp $ */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -2030,6 +2030,9 @@
 		pts[i] = (int *) gdCalloc(im->sx, sizeof(int));
 
 		if (!pts[i]) {
+			for (--i ; i >= 0; i--) {
+				gdFree(pts[i]);
+			}
 			return;
 		}
 	}