GNOME Bugzilla – Bug 755277
rtptheoradepay: Memory leaks
Last modified: 2015-09-20 08:14:51 UTC
rtptheoradepay has a few memory leaks that are easy to spot once tests/examples/rtp/*rtpaux.c are tweaked to handle EOS and are run in valgrind. When locating these memory leaks I noticed that theora and vorbis are implemented almost identically in rtppay/-depay so I started comparing them. The same memory leaks have already been addressed in 2009 in commit http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=06efeff5d979576a252e5dae57f46d6445b1df12 The attached patch series depend on the patch from https://bugzilla.gnome.org/show_bug.cgi?id=755265 and compiles, the unit tests look no worse than before and valgrind no longer complains about leaks when running the tweaked examples-code.
Created attachment 311679 [details] [review] Proposed patch to make rtpvorbis* and rtptheora* as identical as possible
Created attachment 311680 [details] [review] Proposed patch plugging the memory leaks
commit 905295ea34e441232171e462fb859f699e6a288f Author: Sebastian Rasmussen <sebras@hotmail.com> Date: Sat Sep 19 17:02:18 2015 +0200 rtptheoradepay: Fix memory leaks The same memory leaks were fixed in identical fashion for vorbisdepay in 06efeff5d979576a252e5dae57f46d6445b1df12 in 2009. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=755277 commit 2d7bfc13141ad751e2de833b85efa11a2b8a52ef Author: Sebastian Rasmussen <sebras@hotmail.com> Date: Sat Sep 19 17:04:07 2015 +0200 rtp{vorbis,theora}{pay,depay}: Cosmetic cleanup * use g_list_free_full(), don't iterate elements maually when freeing * call gst_rtp_*_pay_clear_packet(), don't duplicate its code * use gst_buffer_unref() to clarify that it is buffers being released, instead of refering directly to gst_mini_object_unref() Fixes https://bugzilla.gnome.org/show_bug.cgi?id=755277