From 92d4496fac3a1e936ea3d7da147e60624c03e82c Mon Sep 17 00:00:00 2001 From: Anthony Petrov Date: Thu, 1 Oct 2009 14:48:05 +0400 Subject: [PATCH] 6886868: giflib has a memory leak in the MakeMapObject() function Free() the object before returning NULL Reviewed-by: art, dcherepanov --- jdk/src/share/native/sun/awt/giflib/gifalloc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/src/share/native/sun/awt/giflib/gifalloc.c b/jdk/src/share/native/sun/awt/giflib/gifalloc.c index 18462471ce7..aae33e2c652 100644 --- a/jdk/src/share/native/sun/awt/giflib/gifalloc.c +++ b/jdk/src/share/native/sun/awt/giflib/gifalloc.c @@ -88,6 +88,7 @@ MakeMapObject(int ColorCount, Object->Colors = (GifColorType *)calloc(ColorCount, sizeof(GifColorType)); if (Object->Colors == (GifColorType *) NULL) { + free(Object); return ((ColorMapObject *) NULL); }