mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-26 15:34:37 +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) {
|
if (options->num_user_hostfiles == 0) {
|
||||||
options->user_hostfiles[options->num_user_hostfiles++] =
|
options->user_hostfiles[options->num_user_hostfiles++] =
|
||||||
#ifdef WIN32_FIXME
|
#ifdef WIN32_FIXME
|
||||||
user_hostfile_name ;
|
xstrdup(user_hostfile_name);
|
||||||
#else
|
#else
|
||||||
xstrdup(_PATH_SSH_USER_HOSTFILE);
|
xstrdup(_PATH_SSH_USER_HOSTFILE);
|
||||||
#endif
|
#endif
|
||||||
options->user_hostfiles[options->num_user_hostfiles++] =
|
options->user_hostfiles[options->num_user_hostfiles++] =
|
||||||
#ifdef WIN32_FIXME
|
#ifdef WIN32_FIXME
|
||||||
user_hostfile_name2 ;
|
xstrdup(user_hostfile_name2);
|
||||||
#else
|
#else
|
||||||
xstrdup(_PATH_SSH_USER_HOSTFILE2);
|
xstrdup(_PATH_SSH_USER_HOSTFILE2);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user