gst: Fix string leak when G_VALUE_COLLECT_INIT() was failed

Returned string should be freed

Fixes #319
This commit is contained in:
Seungha Yang 2018-12-11 20:12:41 +09:00
parent 5f469abbed
commit 3332e39baa
4 changed files with 5 additions and 0 deletions

View file

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

View file

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

View file

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

View file

@ -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 */