webrtcice: Avoid access memory after free and fix memory leak 62/260362/1
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 24 Jun 2021 01:59:54 +0000 (10:59 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 24 Jun 2021 01:59:54 +0000 (10:59 +0900)
[Version] 1.16.2-16
[Issue Type] SVACE (PASSED_TO_PROC_AFTER_FREE.EX)

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

index ed4c925..473da7f 100644 (file)
@@ -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);
index 3b08d2a..ced3d70 100644 (file)
@@ -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