From 40a6f2dc91314ef34076520d2918d4401f078eac Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 21 Apr 2023 17:56:06 -0400 Subject: [PATCH] discover: Avoid double freee when creating info from cache file Passing ownership to the function as the created info is made owner. Part-of: --- .../gst-plugins-base/gst-libs/gst/pbutils/gstdiscoverer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/pbutils/gstdiscoverer.c b/subprojects/gst-plugins-base/gst-libs/gst/pbutils/gstdiscoverer.c index 23a326f265..678e1d07c7 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/pbutils/gstdiscoverer.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/pbutils/gstdiscoverer.c @@ -1850,12 +1850,16 @@ _get_info_from_cachefile (GstDiscoverer * dc, gchar * cachefile) if (info) { info->cachefile = cachefile; info->from_cache = (gpointer) 0x01; + } else { + g_free (cachefile); } GST_INFO_OBJECT (dc, "Got info from cache: %p", info); g_free (data); return info; + } else { + g_free (cachefile); } return NULL; @@ -1871,7 +1875,6 @@ load_serialized_info (GstDiscoverer * dc, gchar * uri) if (cachefile) { res = _get_info_from_cachefile (dc, cachefile); - g_free (cachefile); } }