From: Sangchul Lee Date: Thu, 24 Jun 2021 01:59:54 +0000 (+0900) Subject: webrtcice: Avoid access memory after free and fix memory leak X-Git-Tag: accepted/tizen/unified/20220217.153506~2^2~10^2~9^2~12^2~2^2~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3d1d81a65bee4330531e306de16176960bed239;p=platform%2Fupstream%2Fgstreamer.git webrtcice: Avoid access memory after free and fix memory leak [Version] 1.16.2-16 [Issue Type] SVACE (PASSED_TO_PROC_AFTER_FREE.EX) Change-Id: I61f9148466ec842972cf44d8e87a01e8a504b363 Signed-off-by: Sangchul Lee --- diff --git a/ext/webrtc/gstwebrtcice.c b/ext/webrtc/gstwebrtcice.c index ed4c925..473da7f 100644 --- a/ext/webrtc/gstwebrtcice.c +++ b/ext/webrtc/gstwebrtcice.c @@ -631,7 +631,11 @@ gst_webrtc_ice_add_candidate (GstWebRTCICE * ice, GstWebRTCICEStream * stream, if (!cand) { /* might be a .local candidate */ char *prefix = NULL, *address = NULL, *postfix = NULL; +#ifndef __TIZEN__ char *new_addr, *new_candidate; +#else + char *new_addr = NULL, *new_candidate = NULL; +#endif char *new_candv[4] = { NULL, }; if (!get_candidate_address (candidate, &prefix, &address, &postfix)) { @@ -663,19 +667,33 @@ gst_webrtc_ice_add_candidate (GstWebRTCICE * ice, GstWebRTCICEStream * stream, cand = nice_agent_parse_remote_candidate_sdp (ice->priv->nice_agent, item->nice_stream_id, new_candidate); +#ifndef __TIZEN__ g_free (new_candidate); +#endif if (!cand) { GST_WARNING_OBJECT (ice, "Could not parse candidate \'%s\'", new_candidate); goto fail; } +#ifdef __TIZEN__ + g_free (new_addr); + g_free (new_candidate); + g_free (prefix); + g_free (address); + g_free (postfix); +#else g_free (prefix); g_free (new_addr); g_free (postfix); +#endif if (0) { fail: +#ifdef __TIZEN__ + g_free (new_addr); + g_free (new_candidate); +#endif g_free (prefix); g_free (address); g_free (postfix); diff --git a/packaging/gst-plugins-bad.spec b/packaging/gst-plugins-bad.spec index 3b08d2a..ced3d70 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: 15 +Release: 16 Summary: GStreamer Streaming-Media Framework Plug-Ins License: LGPL-2.0+ Group: Multimedia/Framework