]> git.sesse.net Git - vlc/commitdiff
sftp: close sockets
authorPetri Hintukainen <phintuka@gmail.com>
Thu, 12 Mar 2015 12:26:49 +0000 (14:26 +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 16159a88a12363ceac930079ff588b726df98bb9..f1d0b61c24cd34aa38ae4e8209cee26e3590518d 100644 (file)
@@ -107,6 +107,7 @@ static int Open( vlc_object_t* p_this )
         return VLC_EGENERIC;
 
     STANDARD_BLOCK_ACCESS_INIT;
+    p_sys->i_socket = -1;
 
     /* Parse the URL */
     const char* path = p_access->psz_location;
@@ -251,6 +252,7 @@ error:
     free( psz_password );
     free( psz_username );
     vlc_UrlClean( &url );
+    net_Close( p_sys->i_socket );
     free( p_sys );
     return VLC_EGENERIC;
 }
@@ -266,6 +268,7 @@ static void Close( vlc_object_t* p_this )
     libssh2_sftp_shutdown( p_sys->sftp_session );
 
     libssh2_session_free( p_sys->ssh_session );
+    net_Close( p_sys->i_socket );
     free( p_sys );
 }