From b337cf4d81fec6cf98e8d50c58a80f221fc478ae Mon Sep 17 00:00:00 2001 From: "pnunn%netscape.com" Date: Tue, 22 Aug 2000 23:32:31 +0000 Subject: [PATCH] bug#49149, 48797, 47098: fix leak in gif colormap (local and global). git-svn-id: svn://10.0.0.236/trunk@76903 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/modules/libimg/gifcom/gif.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mozilla/modules/libimg/gifcom/gif.cpp b/mozilla/modules/libimg/gifcom/gif.cpp index 661b25a9e88..75bfa8c0a0b 100644 --- a/mozilla/modules/libimg/gifcom/gif.cpp +++ b/mozilla/modules/libimg/gifcom/gif.cpp @@ -1679,16 +1679,18 @@ il_gif_abort(il_container *ic) * present, will be freed when the image container is * destroyed. */ - + if (gs->is_local_colormap_defined) { - if (gs->global_colormap) { - PR_FREEIF(gs->global_colormap); - gs->global_colormap = NULL; - } - } else { if (gs->local_colormap) { PR_FREEIF(gs->local_colormap); gs->local_colormap = NULL; + ic->src_header->color_space->cmap.map = NULL; + } + } else { + if (gs->global_colormap) { + PR_FREEIF(gs->global_colormap); + gs->global_colormap = NULL; + ic->src_header->color_space->cmap.map = NULL; } }