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:
Wim Taymans 2009-03-11 14:08:10 +01:00
parent 16225d45be
commit 18f612ffa9

View file

@ -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;