[tracker/tracker-0.12] tracker-extract: Do not possibly leak TrackerExtractInfos



commit 54210df9f53473b0deb5d1127ee43b7ad798779b
Author: Carlos Garnacho <carlos lanedo com>
Date:   Fri Nov 25 12:29:43 2011 +0100

    tracker-extract: Do not possibly leak TrackerExtractInfos

 src/tracker-extract/tracker-extract.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract.c b/src/tracker-extract/tracker-extract.c
index 86f3065..04d1f38 100644
--- a/src/tracker-extract/tracker-extract.c
+++ b/src/tracker-extract/tracker-extract.c
@@ -333,6 +333,7 @@ get_file_metadata (TrackerExtractTask  *task,
 	}
 #endif /* HAVE_LIBSTREAMANALYZER */
 	else {
+		tracker_extract_info_unref (info);
 		return FALSE;
 	}
 
@@ -362,12 +363,14 @@ get_file_metadata (TrackerExtractTask  *task,
 		g_free (mime_used);
 	}
 
-	*info_out = info;
-
 	if (items == 0) {
 		g_debug ("No extractor or failed");
+		tracker_extract_info_unref (info);
+		info = NULL;
 	}
 
+	*info_out = info;
+
 	return (items > 0);
 }
 



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