mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 13:06:23 +00:00
caps: Don't leak features on error cases
If we fail to parse fields, we would end up leaking the features we parsed just before CID #1212152
This commit is contained in:
parent
e73907200c
commit
25bcc2d7f6
1 changed files with 3 additions and 0 deletions
|
@ -2299,12 +2299,15 @@ gst_caps_from_string_inplace (GstCaps * caps, const gchar * string)
|
|||
|
||||
if (!priv_gst_structure_parse_fields (s, &s, structure)) {
|
||||
gst_structure_free (structure);
|
||||
if (features)
|
||||
gst_caps_features_free (features);
|
||||
g_free (copy);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
append:
|
||||
gst_caps_append_structure_unchecked (caps, structure, features);
|
||||
features = NULL;
|
||||
if (*s == '\0')
|
||||
break;
|
||||
} while (TRUE);
|
||||
|
|
Loading…
Reference in a new issue