[vlc-devel] [PATCH] sftp: close sockets

Petri Hintukainen phintuka at users.sourceforge.net
Thu Mar 12 13:26:49 CET 2015


From: Petri Hintukainen <phintuka at gmail.com>

---
 modules/access/sftp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/access/sftp.c b/modules/access/sftp.c
index a662c34..ef30727 100644
--- a/modules/access/sftp.c
+++ b/modules/access/sftp.c
@@ -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;
@@ -249,6 +250,7 @@ error:
     free( psz_password );
     free( psz_username );
     vlc_UrlClean( &url );
+    net_Close( p_sys->i_socket );
     free( p_sys );
     return VLC_EGENERIC;
 }
@@ -264,6 +266,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 );
 }
 
-- 
2.1.0




More information about the vlc-devel mailing list