[Bug 789358] playbin: Memory not freed in failure case in gst_playback_utils_get_n_common_capsfeatures()

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Fri Jan 12 12:11:34 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=789358

Tim-Philipp Müller <t.i.m at zen.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #362606|none                        |reviewed
             status|                            |

--- Comment #7 from Tim-Philipp Müller <t.i.m at zen.co.uk> ---
Comment on attachment 362606
  --> https://bugzilla.gnome.org/attachment.cgi?id=362606
[PATCH] playback-utils: Fix memory leak on failure

>   fact1_tmpl_caps = get_template_caps (fact1, GST_PAD_SRC);
>   fact2_tmpl_caps = get_template_caps (fact2, GST_PAD_SINK);
>
>   if (!fact1_tmpl_caps || !fact2_tmpl_caps) {
>     ...
>+    if (fact1_tmpl_caps)
>+      gst_caps_unref (fact1_tmpl_caps);
>+    else if (fact2_tmpl_caps)
>+      gst_caps_unref (fact2_tmpl_caps);
>     return 0;
>   }

Why the else ? Why not just 2x  if (caps) unref(caps) ?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list