While calling gst_value_deserialize_sample, if there is a failure
after caps is ref'ed, then caps is getting leaked. Hence checking for
caps in fail: goto condition and unref'ing it
https://bugzilla.gnome.org/show_bug.cgi?id=753338
GValue bval = G_VALUE_INIT, sval = G_VALUE_INIT;
GstStructure *info;
GstSample *sample;
- GstCaps *caps;
+ GstCaps *caps = NULL;
gboolean ret = FALSE;
gchar **fields;
gsize outlen;
caps = gst_caps_from_string (fields[1]);
if (caps == NULL)
goto fail;
- } else {
- caps = NULL;
}
if (strcmp (fields[2], "None") != 0) {
g_value_take_boxed (dest, sample);
- if (caps)
- gst_caps_unref (caps);
-
ret = TRUE;
fail:
-
+ if (caps)
+ gst_caps_unref (caps);
g_value_unset (&bval);
g_value_unset (&sval);