strdup the proxycmd to avoid crash when freeing, from Lluís Batlle i Rossell

This commit is contained in:
Matt Johnston 2013-07-08 22:42:32 +08:00
parent ded40babb5
commit aeea70f95f

View File

@ -383,6 +383,13 @@ void cli_getopts(int argc, char ** argv) {
exit(EXIT_FAILURE);
}
#ifdef ENABLE_CLI_PROXYCMD
if (cli_opts.proxycmd) {
/* To match the common path of m_freeing it */
cli_opts.proxycmd = m_strdup(cli_opts.proxycmd);
}
#endif
if (cli_opts.remoteport == NULL) {
cli_opts.remoteport = "22";
}