Fix string leak in rtspmessage

when we remove a header field from a message we must free the value associated
with the key to avoid a memory leak.
This commit is contained in:
Wim Taymans 2009-02-02 10:09:07 +01:00
parent a6bc6220d0
commit 35cec4c006

View file

@ -563,6 +563,7 @@ gst_rtsp_message_remove_header (GstRTSPMessage * msg, GstRTSPHeaderField field,
if (key_value.field == field && (indx == -1 || cnt++ == indx)) { if (key_value.field == field && (indx == -1 || cnt++ == indx)) {
g_array_remove_index (msg->hdr_fields, i); g_array_remove_index (msg->hdr_fields, i);
g_free (key_value.value);
res = GST_RTSP_OK; res = GST_RTSP_OK;
if (indx != -1) if (indx != -1)
break; break;