From 743a039cd14ca7e94f2211aa516112890444a3eb Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 27 Sep 2002 22:06:47 +0000 Subject: [PATCH] Free the context if we cannot allocate the HeaderBuf. 2002-09-27 Federico Mena Quintero * io-ico.c (gdk_pixbuf__ico_image_begin_load): Free the context if we cannot allocate the HeaderBuf. --- gdk-pixbuf/ChangeLog | 5 +++++ gdk-pixbuf/io-ico.c | 1 + 2 files changed, 6 insertions(+) diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 7941df678f..53ac9677dd 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,8 @@ +2002-09-27 Federico Mena Quintero + + * io-ico.c (gdk_pixbuf__ico_image_begin_load): Free the context if + we cannot allocate the HeaderBuf. + 2002-09-27 Federico Mena Quintero * io-bmp.c (OneLine): Fix the update region notification to handle diff --git a/gdk-pixbuf/io-ico.c b/gdk-pixbuf/io-ico.c index cb291dd13f..d54e4103e4 100644 --- a/gdk-pixbuf/io-ico.c +++ b/gdk-pixbuf/io-ico.c @@ -458,6 +458,7 @@ gdk_pixbuf__ico_image_begin_load(ModuleSizeFunc size_func, context->HeaderSize = 54; context->HeaderBuf = g_try_malloc(14 + 40 + 4*256 + 512); if (!context->HeaderBuf) { + g_free (context); g_set_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,