[Bug 754157] caps: fix memory leak when getting caps from static caps

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Aug 27 01:07:42 PDT 2015


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

Sebastian Dröge (slomo) <slomo at coaxion.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #310073|none                        |rejected
             status|                            |

--- Comment #2 from Sebastian Dröge (slomo) <slomo at coaxion.net> ---
Review of attachment 310073:
 --> (https://bugzilla.gnome.org/review?bug=754157&attachment=310073)

::: gst/gstcaps.c
@@ +414,3 @@
       goto no_string;

+    string_caps = gst_caps_from_string (string);

This here is the whole point of the static caps :) On the first call, caps are
created from the string and stored inside the static caps, and all further
calls will just return a new reference of those previously created caps.

The "memory leak" valgrind complains about is a expected one-time allocation.

-- 
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