*caps = gst_caps_from_string (string);
- /* Caps generated from static caps are usually leaked */
- GST_MINI_OBJECT_FLAG_SET (*caps, GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED);
-
/* convert to string */
- if (G_UNLIKELY (*caps == NULL))
+ if (G_UNLIKELY (*caps == NULL)) {
g_critical ("Could not convert static caps \"%s\"", string);
+ goto done;
+ }
+
+ /* Caps generated from static caps are usually leaked */
+ GST_MINI_OBJECT_FLAG_SET (*caps, GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED);
GST_CAT_TRACE (GST_CAT_CAPS, "created %p from string %s", static_caps,
string);