gst-libs/gst/rtsp/gstrtspmessage.c: Fix leaking headers. Fixes #496761.

Original commit message from CVS:
Patch by: Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>
* gst-libs/gst/rtsp/gstrtspmessage.c: (gst_rtsp_message_unset):
Fix leaking headers. Fixes #496761.
This commit is contained in:
Tommi Myöhänen 2007-11-16 11:22:09 +00:00 committed by Wim Taymans
parent 0ccab4d247
commit 385ed6384f
2 changed files with 16 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2007-11-16 Wim Taymans <wim.taymans@gmail.com>
Patch by: Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>
* gst-libs/gst/rtsp/gstrtspmessage.c: (gst_rtsp_message_unset):
Fix leaking headers. Fixes #496761.
2007-11-16 Wim Taymans <wim.taymans@gmail.com>
Patch by: Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>

View file

@ -452,9 +452,16 @@ gst_rtsp_message_unset (GstRTSPMessage * msg)
break;
}
if (msg->hdr_fields != NULL)
g_array_free (msg->hdr_fields, TRUE);
if (msg->hdr_fields != NULL) {
gint i;
for (i = 0; i < msg->hdr_fields->len; i++) {
RTSPKeyValue *keyval = &g_array_index (msg->hdr_fields, RTSPKeyValue, i);
g_free (keyval->value);
}
g_array_free (msg->hdr_fields, TRUE);
}
g_free (msg->body);
memset (msg, 0, sizeof *msg);