xstrdup tftp cleanup from Jeff Garzik
This commit is contained in:
parent
21af752b04
commit
6b2c23d847
@ -387,12 +387,11 @@ int tftp_main(int argc, char **argv)
|
||||
|
||||
serverfile = cp + 1;
|
||||
|
||||
if ((s = strdup(serverstr))) {
|
||||
s[cp - serverstr] = '\0';
|
||||
s = xstrdup(serverstr);
|
||||
s[cp - serverstr] = '\0';
|
||||
|
||||
if ((host = gethostbyname(s))) {
|
||||
bad = 0;
|
||||
}
|
||||
if ((host = gethostbyname(s))) {
|
||||
bad = 0;
|
||||
}
|
||||
|
||||
free(s);
|
||||
|
9
tftp.c
9
tftp.c
@ -387,12 +387,11 @@ int tftp_main(int argc, char **argv)
|
||||
|
||||
serverfile = cp + 1;
|
||||
|
||||
if ((s = strdup(serverstr))) {
|
||||
s[cp - serverstr] = '\0';
|
||||
s = xstrdup(serverstr);
|
||||
s[cp - serverstr] = '\0';
|
||||
|
||||
if ((host = gethostbyname(s))) {
|
||||
bad = 0;
|
||||
}
|
||||
if ((host = gethostbyname(s))) {
|
||||
bad = 0;
|
||||
}
|
||||
|
||||
free(s);
|
||||
|
Loading…
Reference in New Issue
Block a user