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



commit 4069660bafe7ca99fd89896235106cbe22f793aa
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]