[vlc-commits] sftp: do not close(-1)

Rémi Denis-Courmont git at videolan.org
Wed Oct 21 18:45:23 CEST 2015


vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Aug 21 19:51:41 2015 +0300| [9b60d9b66e8220b86381e3b613f4873f8a9b8533] | committer: Jean-Baptiste Kempf

sftp: do not close(-1)

(cherry picked from commit 5a13c1fec1d8350d17b0d7999516383ab2a68238)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=9b60d9b66e8220b86381e3b613f4873f8a9b8533
---

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

diff --git a/modules/access/sftp.c b/modules/access/sftp.c
index b4577ac..d8d132d 100644
--- a/modules/access/sftp.c
+++ b/modules/access/sftp.c
@@ -257,7 +257,8 @@ error:
     free( psz_password );
     free( psz_username );
     vlc_UrlClean( &url );
-    net_Close( p_sys->i_socket );
+    if( p_sys->i_socket >= 0 )
+        net_Close( p_sys->i_socket );
     free( p_sys );
     return VLC_EGENERIC;
 }



More information about the vlc-commits mailing list