[eog/gnome-2-26] Plug two very unlikely leaks in EogImage



commit 661134036e36b8a928a5a2cdfede9f2894238bc1
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Sun Apr 26 11:55:45 2009 +0300

    Plug two very unlikely leaks in EogImage
    
    * src/eog-image.c: (eog_image_set_xmp_data),
    (eog_image_set_exif_data): Unref the EXIF chunk and XMP data
    before setting it.
---
 ChangeLog       |    6 ++++++
 src/eog-image.c |    6 ++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d877719..111ef1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-04-26  Claudio Saavedra  <csaavedra igalia com>
 
+	* src/eog-image.c: (eog_image_set_xmp_data),
+	(eog_image_set_exif_data): Unref the EXIF chunk and XMP data
+	before setting it.
+
+2009-04-26  Claudio Saavedra  <csaavedra igalia com>
+
 	* src/eog-image.c: (eog_image_set_exif_data): Unref the EXIF
 	data before setting it, to avoid leaking it in case it is loaded
 	more than once.
diff --git a/src/eog-image.c b/src/eog-image.c
index f4a846f..585588d 100644
--- a/src/eog-image.c
+++ b/src/eog-image.c
@@ -737,6 +737,9 @@ eog_image_set_xmp_data (EogImage *img, EogMetadataReader *md_reader)
 
 	priv = img->priv;
 
+	if (priv->xmp) {
+		xmp_free (priv->xmp);
+	}
 	priv->xmp = eog_metadata_reader_get_xmp_data (md_reader);
 }
 #endif
@@ -774,6 +777,9 @@ eog_image_set_exif_data (EogImage *img, EogMetadataReader *md_reader)
 		}
 	}
 #else
+	if (priv->exif_chunk) {
+		g_free (exif_chunk);
+	}
 	eog_metadata_reader_get_exif_chunk (md_reader,
 					    &priv->exif_chunk,
 					    &priv->exif_chunk_len);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]