GNOME Bugzilla – Bug 756069
Gstreamer: Fix sample memory leaks
Last modified: 2015-10-07 18:06:26 UTC
When sample is got using gst_tag_list_get_sample_index, the memory should be free'd, else it will be leaked. Adding patches for gst-launch.c and gsttag.c
Created attachment 312656 [details] [review] fix sample memory leak
commit 456ef2aa1d912a8af5283907d2ffb8ca51481c2a Author: Vineeth TM <vineeth.tm@samsung.com> Date: Mon Oct 5 11:12:47 2015 +0900 tests/gst-launch: Fix sample memory leak When sample is got using gst_tag_list_get_sample_index, it should be free'd. https://bugzilla.gnome.org/show_bug.cgi?id=756069
make gst/gsttag.check Running suite(s): GstTag Unexpected critical/warning: gst_mini_object_unref: assertion 'mini_object->refcount > 0' failed 92%: Checks: 14, Failures: 1, Errors: 0 gstcheck.c:79:F:general:test_buffer_tags:0: Unexpected critical/warning: gst_mini_object_unref: assertion 'mini_object->refcount > 0' failed Running suite(s): GstTag Unexpected critical/warning: gst_mini_object_unref: assertion 'mini_object->refcount > 0' failed 92%: Checks: 14, Failures: 1, Errors: 0 gstcheck.c:79:F:general:test_buffer_tags:0: Unexpected critical/warning: gst_mini_object_unref: assertion 'mini_object->refcount > 0' failed make: *** [gst/gsttag.check] Error 1
If we get a sample the test will fail. If we don't get a sample, we free the previous sample over and over again. A much better fix is splitting the test. Having a single test doing lots of assert is just bad practise anyway (recommended reading: http://artofunittesting.com/)
commit 5b3cbbc4941f4705ccccf6b8139b95935cfc47a2 Author: Stefan Sauer <ensonic@users.sf.net> Date: Mon Oct 5 21:29:49 2015 +0200 tests: fix the tag test The previous change (see bgo #756069) was causing us to free the same pointer multiple times. If we actually get a sample back, the test fails, no need to free anything in that case.
Overlooked that.. thanks Stefan :)