From: Sangchul Lee Date: Thu, 24 Jun 2021 02:11:20 +0000 (+0900) Subject: webrtcdatachannel: Fix memory leak X-Git-Tag: accepted/tizen/unified/20210625.170419~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F63%2F260363%2F1;p=platform%2Fupstream%2Fgst-plugins-bad.git webrtcdatachannel: Fix memory leak [Version] 1.16.2-17 [Issue Type] SVACE (MEMORY_LEAK.STRDUP) Change-Id: I8b24e1e01b9f82a952cf53240e6626a55dcedb12 Signed-off-by: Sangchul Lee --- 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