mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-23 14:04:59 +02:00
Use xstrdup instead of static memory assignment to avoid a problem when we try to free
The original code had host file entries pointing to static memory. This memory is freed in tilde_expand_paths. Better to xstrdup like the original openssh code did.
This commit is contained in:
parent
319d1bb581
commit
c2c272eaf1
@ -1895,13 +1895,13 @@ void fill_default_options(Options * options, struct passwd *pw)
|
||||
if (options->num_user_hostfiles == 0) {
|
||||
options->user_hostfiles[options->num_user_hostfiles++] =
|
||||
#ifdef WIN32_FIXME
|
||||
user_hostfile_name ;
|
||||
xstrdup(user_hostfile_name);
|
||||
#else
|
||||
xstrdup(_PATH_SSH_USER_HOSTFILE);
|
||||
#endif
|
||||
options->user_hostfiles[options->num_user_hostfiles++] =
|
||||
#ifdef WIN32_FIXME
|
||||
user_hostfile_name2 ;
|
||||
xstrdup(user_hostfile_name2);
|
||||
#else
|
||||
xstrdup(_PATH_SSH_USER_HOSTFILE2);
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user