From 2392c357d3e598b6bc8031954cc031ae6c933a42 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 3 Nov 2007 02:00:33 +0000 Subject: Use xstrdup/xfree when saving pwname and pwdir; ok deraadt@ --- usr.bin/ssh/ssh.c | 10 +++++----- 1 file 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 * Copyright (c) 1995 Tatu Ylonen , 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 -- cgit v1.2.3