[Bug 735348] New: Memory leak in Acm components

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Sun Aug 24 22:29:30 PDT 2014


https://bugzilla.gnome.org/show_bug.cgi?id=735348
  GStreamer | gst-plugins-bad | unspecified

           Summary: Memory leak in Acm components
    Classification: Platform
           Product: GStreamer
           Version: unspecified
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-bad
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: vineeth.tm at samsung.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


On reviewing the code of AcmEnc.c and AcmMp3Dec.c
could see that there are possible memory leaks.

in *_setup functions, there are memory allocations for pbSrc and pbDst.
Now when there are no other errors, *->is_setup variable will be set to true.
Hence on calling setup again in *_sink_setcaps function, since is_setup
variable is true it will teardown and call setup again. In this case there will
be no leaks.

Now during *_setup call, if it fails to prepare ACM stream, the variable
is_setup will not be set to true. Hence when we try to create the element, it
will not teardown, and the previous allocations will not be freed.

Hence i added free functions when ACM stream fails to prepare.

And i feel it is always better to free memory in failure cases in the same
function, rather than waiting for teardown to free them.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- 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