[Bug 788523] New: Label 'no_connection:' not used to handle connection failure in function 'gst_rtsp_server_transfer_connection'

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Oct 4 16:39:30 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=788523

            Bug ID: 788523
           Summary: Label 'no_connection:' not used to handle connection
                    failure in function
                    'gst_rtsp_server_transfer_connection'
    Classification: Platform
           Product: GStreamer
           Version: 1.12.3
                OS: All
            Status: NEW
          Severity: minor
          Priority: Normal
         Component: gst-rtsp-server
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: kr.ashish at samsung.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

In
File: rtsp-server.c
Function : gst_rtsp_server_transfer_connection 
Line No. : 1121

A goto statement should have been used to label 'no_connection:' to handle
connection failure in case 
  gst_rtsp_client_set_connection (client, conn);
returns a false.

-----------------
gst_rtsp_server_transfer_connection (GstRTSPServer * server, GSocket * socket,
    const gchar * ip, gint port, const gchar * initial_buffer)
{
  GstRTSPClient *client = NULL;
  GstRTSPServerClass *klass;
  GstRTSPConnection *conn;
  GstRTSPResult res;

  klass = GST_RTSP_SERVER_GET_CLASS (server);

  if (klass->create_client)
    client = klass->create_client (server);
  if (client == NULL)
    goto client_failed;

  GST_RTSP_CHECK (gst_rtsp_connection_create_from_socket (socket, ip, port,
          initial_buffer, &conn), no_connection);
  g_object_unref (socket);

  /* set connection on the client now */
  gst_rtsp_client_set_connection (client, conn);
//-------------------------------------
//goto no_connection if gst_rtsp_client_set_connection is false
//-------------------------------
  /* manage the client connection */
  manage_client (server, client);

  return TRUE;

  /* ERRORS */
client_failed:
  {
    GST_ERROR_OBJECT (server, "failed to create a client");
    g_object_unref (socket);
    return FALSE;
  }
no_connection:
  {
    gchar *str = gst_rtsp_strresult (res);
    GST_ERROR ("could not create connection from socket %p: %s", socket, str);
    g_free (str);
    g_object_unref (socket);
    return FALSE;
  }
}
------------------------------------

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list