[tracker/wip/extract-graphs: 13/30] tracker-extract: Fix potential memory leak with XMP where string



commit d6913b3e9e649b13703dbbfc1385569e0cc10e0a
Author: Martyn Russell <martyn lanedo com>
Date:   Mon Sep 5 15:18:32 2011 +0100

    tracker-extract: Fix potential memory leak with XMP where string

 src/tracker-extract/tracker-extract-xmp.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-xmp.c b/src/tracker-extract/tracker-extract-xmp.c
index b9f2746..ae4a10c 100644
--- a/src/tracker-extract/tracker-extract-xmp.c
+++ b/src/tracker-extract/tracker-extract-xmp.c
@@ -139,10 +139,8 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
 
 	if (g_file_get_contents (filename, &contents, &length, &error)) {
 		gchar *original_uri;
-		GString *where;
 
 		original_uri = find_orig_uri (filename);
-		where = g_string_new ("");
 
 		/* If no orig file is found for the sidekick, we use the sidekick to
 		 * describe itself instead, falling back to uri 
@@ -152,6 +150,9 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
 		                      original_uri ? original_uri : uri);
 
 		if (xd) {
+			GString *where;
+
+			where = g_string_new ("");
 			tracker_xmp_apply (preupdate, metadata, where, uri, xd);
 			tracker_extract_info_set_where_clause (info,
 			                                       g_string_free (where, FALSE));



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