[vlc-commits] sftp: close sockets

Petri Hintukainen git at videolan.org
Thu Mar 12 14:21:24 CET 2015


vlc | branch: master | Petri Hintukainen <phintuka at gmail.com> | Thu Mar 12 14:26:49 2015 +0200| [063838110416e60e0a8dec864c58c3b896d8c352] | committer: Jean-Baptiste Kempf

sftp: close sockets

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=063838110416e60e0a8dec864c58c3b896d8c352
---

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

diff --git a/modules/access/sftp.c b/modules/access/sftp.c
index 16159a8..f1d0b61 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;
@@ -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 );
 }
 



More information about the vlc-commits mailing list