[gimp] plug-ins: fix memory leak in psd-save
- From: Michael Henning <mhenning src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] plug-ins: fix memory leak in psd-save
- Date: Tue, 15 Jan 2013 22:12:30 +0000 (UTC)
commit 0f6044ef2bb442bff8c104bd28068051493f9faf
Author: Michael Henning <drawoc darkrefraction com>
Date: Tue Jan 15 17:10:33 2013 -0500
plug-ins: fix memory leak in psd-save
Found using clang's scan-build.
plug-ins/file-psd/psd-save.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/file-psd/psd-save.c b/plug-ins/file-psd/psd-save.c
index 2103fee..9b30ce1 100644
--- a/plug-ins/file-psd/psd-save.c
+++ b/plug-ins/file-psd/psd-save.c
@@ -1065,7 +1065,7 @@ save_layer_and_mask (FILE *fd,
/* Create first array dimension (layers, channels) */
- ChannelLengthPos = g_new (glong *, PSDImageData.nLayers);
+ ChannelLengthPos = g_newa (glong *, PSDImageData.nLayers);
/* Layer and mask information section */
@@ -1233,6 +1233,7 @@ save_layer_and_mask (FILE *fd,
{
IFDBG printf ("\t\tWriting pixel data for layer slot %d\n", i);
write_pixel_data(fd, PSDImageData.lLayers[i], ChannelLengthPos[i], 0);
+ g_free (ChannelLengthPos[i]);
}
eof_pos = ftell (fd);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]