mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
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>
This commit is contained in:
parent
b471f75ea0
commit
adb044c9ed
1 changed files with 5 additions and 12 deletions
|
@ -1438,15 +1438,6 @@ free_param_data (ParameterRequest * req)
|
|||
g_free (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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue