webrtcdatachannel: Fix memory leak 63/260363/1
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 24 Jun 2021 02:11:20 +0000 (11:11 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 24 Jun 2021 02:11:20 +0000 (11:11 +0900)
[Version] 1.16.2-17
[Issue Type] SVACE (MEMORY_LEAK.STRDUP)

Change-Id: I8b24e1e01b9f82a952cf53240e6626a55dcedb12
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
ext/webrtc/webrtcdatachannel.c
packaging/gst-plugins-bad.spec

index fde1261..75981a0 100644 (file)
@@ -793,7 +793,11 @@ webrtc_data_channel_send_string (GstWebRTCDataChannel * base_channel,
     ppid = DATA_CHANNEL_PPID_WEBRTC_STRING_EMPTY;
   } else {
     gsize size = strlen (str);
+#ifndef __TIZEN__
     gchar *str_copy = g_strdup (str);
+#else
+    gchar *str_copy;
+#endif
 
     if (!_is_within_max_message_size (channel, size)) {
       GError *error = NULL;
@@ -806,6 +810,9 @@ webrtc_data_channel_send_string (GstWebRTCDataChannel * base_channel,
       return;
     }
 
+#ifdef __TIZEN__
+    str_copy = g_strdup (str);
+#endif
     buffer =
         gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, str_copy,
         size, 0, size, str_copy, g_free);
index ced3d70..89c5b94 100644 (file)
@@ -4,7 +4,7 @@
 
 Name:           gst-plugins-bad
 Version:        1.16.2
-Release:        16
+Release:        17
 Summary:        GStreamer Streaming-Media Framework Plug-Ins
 License:        LGPL-2.0+
 Group:          Multimedia/Framework