[gimp/soc-2011-seamless-clone2] plug-ins: fix memory leak in file-mng
- From: Clayton Walker <claytonw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/soc-2011-seamless-clone2] plug-ins: fix memory leak in file-mng
- Date: Wed, 8 May 2013 14:57:23 +0000 (UTC)
commit 2f907169c4c7e01085e392c4cdd0bf87edbc5d0a
Author: Michael Henning <drawoc darkrefraction com>
Date: Thu Jan 17 19:23:15 2013 -0500
plug-ins: fix memory leak in file-mng
Found using clang's scan-build.
plug-ins/common/file-mng.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/common/file-mng.c b/plug-ins/common/file-mng.c
index a022543..5278ae0 100644
--- a/plug-ins/common/file-mng.c
+++ b/plug-ins/common/file-mng.c
@@ -469,7 +469,9 @@ respin_cmap (png_structp pp,
/* Make sure there is something in the colormap */
if (colors == 0)
{
- before = g_new0 (guchar, 3);
+ before = g_newa (guchar, 3);
+ memset (before, 0, sizeof (guchar) * 3);
+
colors = 1;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]