discover: Avoid double freee when creating info from cache file

Passing ownership to the function as the created info is made owner.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3911>
This commit is contained in:
Thibault Saunier 2023-04-21 17:56:06 -04:00
parent 0f229aa62a
commit 40a6f2dc91

View file

@ -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);
}
}