6886868: giflib has a memory leak in the MakeMapObject() function
authoranthony
Thu, 01 Oct 2009 14:48:05 +0400
changeset 3970 a7c4a8080cc1
parent 3969 6e77be3973ea
child 3971 067e6580a577
6886868: giflib has a memory leak in the MakeMapObject() function Summary: free() the object before returning NULL Reviewed-by: art, dcherepanov
jdk/src/share/native/sun/awt/giflib/gifalloc.c
--- a/jdk/src/share/native/sun/awt/giflib/gifalloc.c	Wed Sep 30 15:48:06 2009 +0400
+++ b/jdk/src/share/native/sun/awt/giflib/gifalloc.c	Thu Oct 01 14:48:05 2009 +0400
@@ -88,6 +88,7 @@
 
     Object->Colors = (GifColorType *)calloc(ColorCount, sizeof(GifColorType));
     if (Object->Colors == (GifColorType *) NULL) {
+        free(Object);
         return ((ColorMapObject *) NULL);
     }