From 6142cd80ba7802049193e29e508dd47a0252cbb6 Mon Sep 17 00:00:00 2001 From: anthony Date: Thu, 1 Oct 2009 14:48:05 +0400 Subject: [PATCH] 6886868: giflib has a memory leak in the MakeMapObject() function Summary: free() the object before returning NULL Reviewed-by: art, dcherepanov --- src/share/native/sun/awt/giflib/gifalloc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/share/native/sun/awt/giflib/gifalloc.c b/src/share/native/sun/awt/giflib/gifalloc.c index 18462471c..aae33e2c6 100644 --- a/src/share/native/sun/awt/giflib/gifalloc.c +++ b/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); } -- GitLab