From a22dad76e5329b00c5bfa29a68bb18002306dd94 Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Thu, 24 Jun 2021 11:11:20 +0900 Subject: [PATCH] webrtcdatachannel: Fix memory leak [Version] 1.16.2-17 [Issue Type] SVACE (MEMORY_LEAK.STRDUP) Change-Id: I8b24e1e01b9f82a952cf53240e6626a55dcedb12 Signed-off-by: Sangchul Lee --- ext/webrtc/webrtcdatachannel.c | 7 +++++++ packaging/gst-plugins-bad.spec | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ext/webrtc/webrtcdatachannel.c b/ext/webrtc/webrtcdatachannel.c index fde1261..75981a0 100644 --- a/ext/webrtc/webrtcdatachannel.c +++ b/ext/webrtc/webrtcdatachannel.c @@ -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); diff --git a/packaging/gst-plugins-bad.spec b/packaging/gst-plugins-bad.spec index ced3d70..89c5b94 100644 --- a/packaging/gst-plugins-bad.spec +++ b/packaging/gst-plugins-bad.spec @@ -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 -- 2.7.4