[SSH] Always initialize .port field.

This commit is contained in:
qball 2019-05-10 20:29:11 +02:00
parent cf8b76c6a6
commit 871ea42785
1 changed files with 8 additions and 6 deletions

View File

@ -303,6 +303,7 @@ static SshEntry *read_hosts_file ( SshEntry * retv, unsigned int *length )
retv = g_realloc ( retv,
( ( *length ) + 2 ) * sizeof ( char* ) );
retv[( *length )].hostname = g_strdup ( token );
retv[( *length )].port = 0;
retv[( *length ) + 1].hostname = NULL;
( *length )++;
}
@ -430,6 +431,7 @@ static void parse_ssh_config_file ( SSHModePrivateData *pd, const char *filename
// Add this host name to the list.
( *retv ) = g_realloc ( ( *retv ), ( ( *length ) + 2 ) * sizeof ( SshEntry ) );
( *retv )[( *length )].hostname = g_strdup ( token );
( *retv )[( *length )].port = 0;
( *retv )[( *length ) + 1].hostname = NULL;
( *length )++;
}