]> git.sesse.net Git - vlc/commitdiff
sftp: invalid free()
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 13 Apr 2013 15:28:08 +0000 (18:28 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 13 Apr 2013 15:28:08 +0000 (18:28 +0300)
modules/access/sftp.c

index 2872963d2ddd33dc61ccfdf26d618ae5430151bd..6f1e8e43a04f35f3ede053fbf52fdc29e4e7ec94 100644 (file)
@@ -172,9 +172,11 @@ static int Open( vlc_object_t* p_this )
     char *psz_home = config_GetUserDir( VLC_HOME_DIR );
     char *psz_knownhosts_file;
     if( asprintf( &psz_knownhosts_file, "%s/.ssh/known_hosts", psz_home ) != -1 )
+    {
         libssh2_knownhost_readfile( ssh_knownhosts, psz_knownhosts_file,
                 LIBSSH2_KNOWNHOST_FILE_OPENSSH );
-    free( psz_knownhosts_file );
+        free( psz_knownhosts_file );
+    }
     free( psz_home );
 
     const char *fingerprint = libssh2_session_hostkey( p_sys->ssh_session, &i_len, &i_type );