hlsdemux2: Free current_segment on finalize

Avoid a memory leak by making sure to release the
current segment on exit if non-NULL

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2676>
This commit is contained in:
Jan Schmidt 2022-06-23 19:24:03 +10:00 committed by GStreamer Marge Bot
parent 9272943bc7
commit 76e0333213

View file

@ -1684,6 +1684,11 @@ gst_hls_demux_stream_finalize (GObject * object)
gst_hls_rendition_stream_unref (hls_stream->pending_rendition);
hls_stream->pending_rendition = NULL;
}
if (hls_stream->current_segment) {
gst_m3u8_media_segment_unref (hls_stream->current_segment);
hls_stream->current_segment = NULL;
}
gst_hls_demux_stream_decrypt_end (hls_stream);
G_OBJECT_CLASS (stream_parent_class)->finalize (object);