gst-libs/gst/rtsp/gstrtspmessage.c: Fix leaking headers. Fixes #496761.
authorTommi Myöhänen <ext-tommi.myohanen@nokia.com>
Fri, 16 Nov 2007 11:22:09 +0000 (11:22 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 16 Nov 2007 11:22:09 +0000 (11:22 +0000)
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.

ChangeLog
gst-libs/gst/rtsp/gstrtspmessage.c

index aeadd28..50919c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,13 @@
 
        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>
+
        * sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
        (gst_ximagesink_change_state):
        * sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get):
index 297cdc3..c1dc4d9 100644 (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);