mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-18 12:15:19 +00:00
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:
parent
0f229aa62a
commit
40a6f2dc91
1 changed files with 4 additions and 1 deletions
|
@ -1850,12 +1850,16 @@ _get_info_from_cachefile (GstDiscoverer * dc, gchar * cachefile)
|
||||||
if (info) {
|
if (info) {
|
||||||
info->cachefile = cachefile;
|
info->cachefile = cachefile;
|
||||||
info->from_cache = (gpointer) 0x01;
|
info->from_cache = (gpointer) 0x01;
|
||||||
|
} else {
|
||||||
|
g_free (cachefile);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_INFO_OBJECT (dc, "Got info from cache: %p", info);
|
GST_INFO_OBJECT (dc, "Got info from cache: %p", info);
|
||||||
g_free (data);
|
g_free (data);
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
|
} else {
|
||||||
|
g_free (cachefile);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1871,7 +1875,6 @@ load_serialized_info (GstDiscoverer * dc, gchar * uri)
|
||||||
|
|
||||||
if (cachefile) {
|
if (cachefile) {
|
||||||
res = _get_info_from_cachefile (dc, cachefile);
|
res = _get_info_from_cachefile (dc, cachefile);
|
||||||
g_free (cachefile);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue