summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2007-11-03 02:00:33 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2007-11-03 02:00:33 +0000
commit2392c357d3e598b6bc8031954cc031ae6c933a42 (patch)
tree5c4faccb55e79d01e437d14f5fc3f367abf4445e
parent83d6d110b2c36debd99e91e5e48492b4d0943431 (diff)
Use xstrdup/xfree when saving pwname and pwdir; ok deraadt@
-rw-r--r--usr.bin/ssh/ssh.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index d575f2ee552..71b837b7822 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.306 2007/11/03 01:24:06 deraadt Exp $ */
+/* $OpenBSD: ssh.c,v 1.307 2007/11/03 02:00:32 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1240,8 +1240,8 @@ load_public_identity_files(void)
#endif /* SMARTCARD */
if ((pw = getpwuid(original_real_uid)) == NULL)
fatal("load_public_identity_files: getpwuid failed");
- pwname = strdup(pw->pw_name);
- pwdir = strdup(pw->pw_dir);
+ pwname = xstrdup(pw->pw_name);
+ pwdir = xstrdup(pw->pw_dir);
if (gethostname(thishost, sizeof(thishost)) == -1)
fatal("load_public_identity_files: gethostname: %s",
strerror(errno));
@@ -1260,9 +1260,9 @@ load_public_identity_files(void)
options.identity_keys[i] = public;
}
bzero(pwname, strlen(pwname));
- free(pwname);
+ xfree(pwname);
bzero(pwdir, strlen(pwdir));
- free(pwdir);
+ xfree(pwdir);
}
static void