diff options
author | Ognyan Tonchev <ognyan@axis.com> | 2020-07-14 13:14:09 +0200 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2020-07-15 13:19:38 +0000 |
commit | adb044c9ed4edfd90f3df2a5fb986415459e804f (patch) | |
tree | bc5eb5572a0513b7410683ed9fce4074927424ea /gst | |
parent | b471f75ea0e97977d080c135e6889bf63b383889 (diff) |
rtspsrc: Fix segfault with illegal free
set_get_param_q is not a pointer so it is illegal to call g_queue_free_full().
Freeing the requests by popping them from the queue instead.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/669>
Diffstat (limited to 'gst')
-rw-r--r-- | gst/rtsp/gstrtspsrc.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 603bdf098..ab794d423 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -1439,15 +1439,6 @@ free_param_data (ParameterRequest * req) } static void -free_param_queue (gpointer data) -{ - ParameterRequest *req = data; - - gst_promise_expire (req->promise); - free_param_data (req); -} - -static void gst_rtspsrc_finalize (GObject * object) { GstRTSPSrc *rtspsrc; @@ -2422,6 +2413,7 @@ static void gst_rtspsrc_cleanup (GstRTSPSrc * src) { GList *walk; + ParameterRequest *req; GST_DEBUG_OBJECT (src, "cleanup"); @@ -2471,9 +2463,10 @@ gst_rtspsrc_cleanup (GstRTSPSrc * src) GST_OBJECT_LOCK (src); /* free parameter requests queue */ - if (!g_queue_is_empty (&src->set_get_param_q)) - g_queue_free_full (&src->set_get_param_q, free_param_queue); - + while ((req = g_queue_pop_head (&src->set_get_param_q))) { + gst_promise_expire (req->promise); + free_param_data (req); + } GST_OBJECT_UNLOCK (src); } |