Delete duplicated code 13/175213/2 accepted/tizen/unified/20180424.082647 submit/tizen/20180424.022406
authorSeokHoon Lee <andy.shlee@samsung.com>
Mon, 9 Apr 2018 08:43:41 +0000 (17:43 +0900)
committerSeokHoon Lee <andy.shlee@samsung.com>
Wed, 11 Apr 2018 03:46:57 +0000 (12:46 +0900)
- delete gst_rtsp_transport_init, it was inlcuded in transport new
- delete g_free(ct_destiantion), it was included in init.
- add transport_free in error case
- add gst_wfd_message_free fro memory leak
- g_free sess_id in case of return.

Signed-off-by: SeokHoon Lee <andy.shlee@samsung.com>
Change-Id: I6ac7aeb95ca69041a0b2949dacd70a731a42fcfc

gst/rtsp-server/rtsp-client-wfd.c [changed mode: 0644->0755]
gst/rtsp-sink/gstrtspclientsink.c
packaging/gst-rtsp-server.spec

old mode 100644 (file)
new mode 100755 (executable)
index 8980e15..b97e49f
@@ -1373,7 +1373,6 @@ handle_ts_response (GstRTSPWFDClient * client, GstRTSPContext * ctx)
   gst_rtsp_stream_transport_set_keepalive (tr, NULL, ctx->session, NULL);
 
   gst_rtsp_transport_new (&ct);
-  gst_rtsp_transport_init (ct);
 
   map_transport (client, ct);
 
@@ -1386,7 +1385,7 @@ handle_ts_response (GstRTSPWFDClient * client, GstRTSPContext * ctx)
     GST_WARNING_OBJECT (client, "Lowertrans is wrong");
     goto error;
   }
-  g_free (ct->destination);
+
   if (client->priv->ts_mode == WFD_TS_UDP) {
     g_print ("\nSwitched to UDP !!!\n");
     /* Free any previous TCP connection */
@@ -1442,6 +1441,7 @@ handle_ts_response (GstRTSPWFDClient * client, GstRTSPContext * ctx)
   return res;
 
 error:
+  gst_rtsp_transport_free (ct);
   g_ptr_array_free (ta, FALSE);
   return GST_RTSP_ERROR;
 }
@@ -1452,6 +1452,8 @@ handle_wfd_response (GstRTSPClient * client, GstRTSPContext * ctx)
   GstRTSPResult res = GST_RTSP_OK;
   guint8 *data = NULL;
   guint size = 0;
+  GstWFDResult wfd_res;
+  GstWFDMessage *msg = NULL;
 
   GstRTSPWFDClient *_client = GST_RTSP_WFD_CLIENT (client);
   GstRTSPWFDClientPrivate *priv = GST_RTSP_WFD_CLIENT_GET_PRIVATE (client);
@@ -1492,8 +1494,6 @@ handle_wfd_response (GstRTSPClient * client, GstRTSPContext * ctx)
   GST_INFO_OBJECT (_client, "Response body is %d", size);
   if (size > 0) {
     if (!priv->m3_done) {
-      GstWFDResult wfd_res;
-      GstWFDMessage *msg = NULL;
       /* Parse M3 response from sink */
       wfd_res = gst_wfd_message_new (&msg);
       if (wfd_res != GST_WFD_OK) {
@@ -1648,8 +1648,6 @@ handle_wfd_response (GstRTSPClient * client, GstRTSPContext * ctx)
           ctx);
     } else {
       if (g_strrstr((char *)data, "wfd2_buffer_len")) {
-        GstWFDResult wfd_res;
-        GstWFDMessage *msg = NULL;
         GST_DEBUG_OBJECT (_client, "Get TS message responce");
 
         /* Parse TS response from sink */
@@ -1703,9 +1701,16 @@ handle_wfd_response (GstRTSPClient * client, GstRTSPContext * ctx)
     }
   }
 
+  if (msg != NULL)
+    gst_wfd_message_free(msg);
+
   return;
 
 error:
+
+  if (msg != NULL)
+    gst_wfd_message_free(msg);
+
   return;
 }
 
index b2aaec8..ba8d96f 100644 (file)
@@ -3920,8 +3920,10 @@ gst_rtsp_client_sink_record (GstRTSPClientSink * sink, gboolean async)
   /* session ID doesn't have to be super-unique in this case */
   sess_id = g_strdup_printf ("%u", g_random_int ());
 
-  if (sink->conninfo.connection == NULL)
+  if (sink->conninfo.connection == NULL) {
+    g_free (sess_id);
     return GST_RTSP_ERROR;
+  }
 
   conn_socket = gst_rtsp_connection_get_read_socket (sink->conninfo.connection);
 
index c7d4d7a..224c787 100644 (file)
@@ -1,7 +1,7 @@
 Name:       gst-rtsp-server
 Summary:    Multimedia Framework Library
 Version:    1.12.2
-Release:    0
+Release:    1
 Url:        http://gstreamer.freedesktop.org/
 Group:      System/Libraries
 License:    LGPL-2.0+