mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-10 07:38:06 -05:00
Turn a rogue malloc to smalloc
[originally from svn r840]
This commit is contained in:
parent
5a908bb1d7
commit
fc478e6cad
2
scp.c
2
scp.c
@ -459,7 +459,7 @@ static void do_cmd(char *host, char *user, char *cmd)
|
||||
namelen = 0;
|
||||
if (GetUserName(user, &namelen) == FALSE)
|
||||
bump("Empty user name");
|
||||
user = malloc(namelen * sizeof(char));
|
||||
user = smalloc(namelen * sizeof(char));
|
||||
GetUserName(user, &namelen);
|
||||
if (verbose) tell_user(stderr, "Guessing user name: %s", user);
|
||||
strncpy(cfg.username, user, sizeof(cfg.username)-1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user