mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 15:51:11 +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);
|
g_free (req);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
free_param_queue (gpointer data)
|
|
||||||
{
|
|
||||||
ParameterRequest *req = data;
|
|
||||||
|
|
||||||
gst_promise_expire (req->promise);
|
|
||||||
free_param_data (req);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_rtspsrc_finalize (GObject * object)
|
gst_rtspsrc_finalize (GObject * object)
|
||||||
{
|
{
|
||||||
|
@ -2422,6 +2413,7 @@ static void
|
||||||
gst_rtspsrc_cleanup (GstRTSPSrc * src)
|
gst_rtspsrc_cleanup (GstRTSPSrc * src)
|
||||||
{
|
{
|
||||||
GList *walk;
|
GList *walk;
|
||||||
|
ParameterRequest *req;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (src, "cleanup");
|
GST_DEBUG_OBJECT (src, "cleanup");
|
||||||
|
|
||||||
|
@ -2471,9 +2463,10 @@ gst_rtspsrc_cleanup (GstRTSPSrc * src)
|
||||||
|
|
||||||
GST_OBJECT_LOCK (src);
|
GST_OBJECT_LOCK (src);
|
||||||
/* free parameter requests queue */
|
/* free parameter requests queue */
|
||||||
if (!g_queue_is_empty (&src->set_get_param_q))
|
while ((req = g_queue_pop_head (&src->set_get_param_q))) {
|
||||||
g_queue_free_full (&src->set_get_param_q, free_param_queue);
|
gst_promise_expire (req->promise);
|
||||||
|
free_param_data (req);
|
||||||
|
}
|
||||||
GST_OBJECT_UNLOCK (src);
|
GST_OBJECT_UNLOCK (src);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue