]> git.sesse.net Git - vlc/commitdiff
sftp: error out if net_Connect fails
authorPetri Hintukainen <phintuka@gmail.com>
Thu, 12 Mar 2015 13:03:23 +0000 (15:03 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 12 Mar 2015 13:21:07 +0000 (14:21 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/access/sftp.c

index f1d0b61c24cd34aa38ae4e8209cee26e3590518d..b4577ac939a5b53180eac92afc80a7e8ec56533f 100644 (file)
@@ -144,6 +144,11 @@ static int Open( vlc_object_t* p_this )
 
     /* Connect to the server using a regular socket */
     p_sys->i_socket = net_Connect( p_access, url.psz_host, i_port, SOCK_STREAM, 0 );
+    if( p_sys->i_socket < 0 )
+    {
+        msg_Err( p_access, "Impossible to open the connection to %s:%i", url.psz_host, i_port );
+        goto error;
+    }
 
     /* Create the ssh connexion and wait until the server answer */
     if( ( p_sys->ssh_session = libssh2_session_init() ) == NULL )