=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/misc.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- src/usr.bin/ssh/misc.c 2006/03/20 17:10:19 1.48 +++ src/usr.bin/ssh/misc.c 2006/03/25 00:05:41 1.49 @@ -170,9 +170,8 @@ struct passwd * pwcopy(struct passwd *pw) { - struct passwd *copy = xmalloc(sizeof(*copy)); + struct passwd *copy = xcalloc(1, sizeof(*copy)); - memset(copy, 0, sizeof(*copy)); copy->pw_name = xstrdup(pw->pw_name); copy->pw_passwd = xstrdup(pw->pw_passwd); copy->pw_gecos = xstrdup(pw->pw_gecos); @@ -682,8 +681,7 @@ u_int i, hl; hl = l * 2 + 1; - r = xmalloc(hl); - *r = '\0'; + r = xcalloc(1, hl); for (i = 0; i < l; i++) { snprintf(b, sizeof(b), "%02x", d[i]); strlcat(r, b, hl);