rtsp-server: fix memory leak 28/314928/2 tizen
authorYoungwoo Cho <young222.cho@samsung.com>
Tue, 23 Jul 2024 08:42:50 +0000 (17:42 +0900)
committerYoungwoo Cho <young222.cho@samsung.com>
Wed, 24 Jul 2024 06:37:39 +0000 (15:37 +0900)
[Version] 1.22.8-13
[Issue Type] KONA

Change-Id: I788e9070c492e7b4bd85c732fcb3ded327041c0b
Signed-off-by: Youngwoo Cho <young222.cho@samsung.com>
subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-client-wfd.c

index ac5d69f..b757919 100644 (file)
@@ -4323,17 +4323,17 @@ gst_rtsp_wfd_client_switch_to_tcp (GstRTSPWFDClient * client)
   GList *tl = NULL;
   GPtrArray *ta = NULL;
 
+  if (client->priv->ts_mode == WFD_TS_TCP) {
+    GST_ERROR_OBJECT (client, "Transport already TCP");
+    return res;
+  }
+
   ta = g_ptr_array_new();
 
   tl = gst_rtsp_stream_transport_filter (client->priv->stats.stream, NULL, NULL);
   client->priv->transports = tl;
   g_ptr_array_add (ta, tl->data);
 
-  if (client->priv->ts_mode == WFD_TS_TCP) {
-    GST_ERROR_OBJECT (client, "Transport already TCP");
-    return res;
-  }
-
   client->priv->ts_mode = WFD_TS_TCP;
   res = prepare_transport_switch_request (client, &request);
   if (GST_RTSP_OK != res) {