mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 11:40:38 +00:00
gst: Fix string leak when G_VALUE_COLLECT_INIT() was failed
Returned string should be freed Fixes #319
This commit is contained in:
parent
5f469abbed
commit
3332e39baa
4 changed files with 5 additions and 0 deletions
|
@ -1049,6 +1049,7 @@ gst_caps_set_simple_valist (GstCaps * caps, const char *field, va_list varargs)
|
|||
G_VALUE_COLLECT_INIT (&value, type, varargs, 0, &err);
|
||||
if (G_UNLIKELY (err)) {
|
||||
g_critical ("%s", err);
|
||||
g_free (err);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -452,6 +452,7 @@ cant_copy:
|
|||
(GST_IS_OBJECT (object) ? GST_OBJECT_NAME (object) : ""), error);
|
||||
g_value_unset (&value);
|
||||
g_object_unref (target);
|
||||
g_free (error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -631,6 +631,7 @@ gst_structure_set_valist_internal (GstStructure * structure,
|
|||
G_VALUE_COLLECT_INIT (&field.value, type, varargs, 0, &err);
|
||||
if (G_UNLIKELY (err)) {
|
||||
g_critical ("%s", err);
|
||||
g_free (err);
|
||||
return;
|
||||
}
|
||||
gst_structure_set_field (structure, &field);
|
||||
|
@ -697,6 +698,7 @@ gst_structure_id_set_valist_internal (GstStructure * structure,
|
|||
G_VALUE_COLLECT_INIT (&field.value, type, varargs, 0, &err);
|
||||
if (G_UNLIKELY (err)) {
|
||||
g_critical ("%s", err);
|
||||
g_free (err);
|
||||
return;
|
||||
}
|
||||
gst_structure_set_field (structure, &field);
|
||||
|
|
|
@ -208,6 +208,7 @@ gst_tracer_record_new (const gchar * name, const gchar * firstfield, ...)
|
|||
G_VALUE_COLLECT_INIT (&val, type, varargs, G_VALUE_NOCOPY_CONTENTS, &err);
|
||||
if (G_UNLIKELY (err)) {
|
||||
g_critical ("%s", err);
|
||||
g_free (err);
|
||||
break;
|
||||
}
|
||||
/* see boxed_proxy_collect_value */
|
||||
|
|
Loading…
Reference in a new issue