GNOME Bugzilla – Bug 794353
rtponviftimestamp: memory leak on finalize
Last modified: 2018-04-06 12:38:23 UTC
There is missing buffer list destruction in gst_rtp_onvif_timestamp_finalize () which can be noticed with: diff --git a/gst/onvif/gstrtponviftimestamp.c b/gst/onvif/gstrtponviftimestamp.c index a957483..674f57d 100644 --- a/gst/onvif/gstrtponviftimestamp.c +++ b/gst/onvif/gstrtponviftimestamp.c @@ -222,6 +222,9 @@ gst_rtp_onvif_timestamp_finalize (GObject * object) g_queue_free (self->event_queue); G_OBJECT_CLASS (gst_rtp_onvif_timestamp_parent_class)->finalize (object); + + g_assert (self->buffer == NULL); + g_assert (self->list == NULL); } Which leads to: [ 8355.912930] test[13119]: ERROR:../../../../../../../../gstreamer1.0-plugins-bad/gst/onvif/gstrtponviftimestamp.c:246:gst_rtp_onvif_timestamp_finalize: assertion failed: (self->list == NULL)
Created attachment 369726 [details] [review] proposed fix
Thanks, the patch looks fine to me and shouldn't hurt, but I wonder in what scenario it would be needed, since it should all really be freed already during the state change when shutting down the element. Could you check if this fixes your leak as well: https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/gst/onvif?id=4d76070f4ec97c6aecbc55ec27997c523aa2b922
@Tim-Philipp Müller I cannot reproduce this issue and my #794290 with your patch in the same scenario. I even added sleeps and checked that normally I always have corruptions and leaks and with your patch (+ sleeps) I haven't got a single one. Thank you!
*** Bug 794290 has been marked as a duplicate of this bug. ***