mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-28 01:05:07 +00:00
rtsp: free the right string.
Free the key value before we remove the header item from the array. The item we retrieved from the array is only valid until we remove it from the array.
This commit is contained in:
parent
16225d45be
commit
18f612ffa9
|
@ -563,8 +563,8 @@ gst_rtsp_message_remove_header (GstRTSPMessage * msg, GstRTSPHeaderField field,
|
|||
RTSPKeyValue *key_value = &g_array_index (msg->hdr_fields, RTSPKeyValue, i);
|
||||
|
||||
if (key_value->field == field && (indx == -1 || cnt++ == indx)) {
|
||||
g_array_remove_index (msg->hdr_fields, i);
|
||||
g_free (key_value->value);
|
||||
g_array_remove_index (msg->hdr_fields, i);
|
||||
res = GST_RTSP_OK;
|
||||
if (indx != -1)
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue