[tracker: 25/30] extract, gst: Ensure GstDiscovererInfo structs aren't leaked
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker: 25/30] extract, gst: Ensure GstDiscovererInfo structs aren't leaked
- Date: Tue, 21 Jan 2014 12:01:12 +0000 (UTC)
commit 100e62c65d3cc6025ff8f57a91a58911a8ae4c2f
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jan 20 20:11:12 2014 +0100
extract,gst: Ensure GstDiscovererInfo structs aren't leaked
gst_discoverer_discover_uri() may return a non-NULL error and
a GstDiscovererInfo pointer, so ensure it is freed in case of
error. The info was also being leaked on successful extraction,
that is fixed too.
src/tracker-extract/tracker-extract-gstreamer.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index 1ded93e..59826ee 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -1410,18 +1410,20 @@ discoverer_init_and_run (MetadataExtractor *extractor,
info = gst_discoverer_discover_uri (extractor->discoverer,
uri,
&error);
+
+ if (!info) {
+ g_warning ("Nothing discovered, bailing out");
+ return TRUE;
+ }
+
if (error) {
g_warning ("Call to gst_discoverer_discover_uri() failed: %s",
error->message);
+ gst_discoverer_info_unref (info);
g_error_free (error);
return FALSE;
}
- if (!info) {
- g_warning ("Nothing discovered, bailing out");
- return TRUE;
- }
-
#if defined(GSTREAMER_BACKEND_GUPNP_DLNA)
{
GUPnPDLNAProfile *profile;
@@ -1496,6 +1498,8 @@ discoverer_init_and_run (MetadataExtractor *extractor,
}
}
+ gst_discoverer_info_unref (info);
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]