diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-08-31 01:55:34 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-08-31 01:55:34 +0000 |
commit | 50a7ca7f2cb0d665d89d12dc3a5325e80a28fc52 (patch) | |
tree | e5b7b1b4aed20691e81a20e85c9acd02dd673f64 /usr.bin/chpass | |
parent | 4add8efd82adb5b7cc333f1cb445de36b36a2605 (diff) |
kill leaks; help from das33@cornell.edu
Diffstat (limited to 'usr.bin/chpass')
-rw-r--r-- | usr.bin/chpass/chpass.c | 12 | ||||
-rw-r--r-- | usr.bin/chpass/edit.c | 6 | ||||
-rw-r--r-- | usr.bin/chpass/pw_yp.c | 7 |
3 files changed, 14 insertions, 11 deletions
diff --git a/usr.bin/chpass/chpass.c b/usr.bin/chpass/chpass.c index 9b8e7fbda81..a0796e9c591 100644 --- a/usr.bin/chpass/chpass.c +++ b/usr.bin/chpass/chpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chpass.c,v 1.3 1996/06/26 05:31:54 deraadt Exp $ */ +/* $OpenBSD: chpass.c,v 1.4 1996/08/31 01:55:32 deraadt Exp $ */ /* $NetBSD: chpass.c,v 1.8 1996/05/15 21:50:43 jtc Exp $ */ /*- @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)chpass.c 8.4 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: chpass.c,v 1.3 1996/06/26 05:31:54 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: chpass.c,v 1.4 1996/08/31 01:55:32 deraadt Exp $"; #endif #endif /* not lint */ @@ -197,12 +197,12 @@ main(argc, argv) #ifdef YP if (use_yp) { - if (pw_yp(pw, uid)) + if (pw_yp(pw, uid)) { pw_error((char *)NULL, 0, 1); - else + exit(1); + } else exit(0); - } - else + } else #endif /* YP */ /* Copy the passwd file to the lock file, updating pw. */ diff --git a/usr.bin/chpass/edit.c b/usr.bin/chpass/edit.c index 81a9a92fa52..a85680ae50e 100644 --- a/usr.bin/chpass/edit.c +++ b/usr.bin/chpass/edit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: edit.c,v 1.7 1996/08/30 13:29:47 deraadt Exp $ */ +/* $OpenBSD: edit.c,v 1.8 1996/08/31 01:55:33 deraadt Exp $ */ /* $NetBSD: edit.c,v 1.6 1996/05/15 21:50:45 jtc Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)edit.c 8.3 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: edit.c,v 1.7 1996/08/30 13:29:47 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: edit.c,v 1.8 1996/08/31 01:55:33 deraadt Exp $"; #endif #endif /* not lint */ @@ -216,6 +216,6 @@ bad: (void)fclose(fp); warnx("entries too long"); return (0); } - free(p); + /* must leave p allocated */ return (pw_scan(buf, pw, (int *)NULL)); } diff --git a/usr.bin/chpass/pw_yp.c b/usr.bin/chpass/pw_yp.c index 9e102393e3e..df0f45f4b1b 100644 --- a/usr.bin/chpass/pw_yp.c +++ b/usr.bin/chpass/pw_yp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pw_yp.c,v 1.3 1996/08/30 13:09:41 deraadt Exp $ */ +/* $OpenBSD: pw_yp.c,v 1.4 1996/08/31 01:55:33 deraadt Exp $ */ /* $NetBSD: pw_yp.c,v 1.5 1995/03/26 04:55:33 glass Exp $ */ /* @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)pw_yp.c 1.0 2/2/93"; #else -static char rcsid[] = "$OpenBSD: pw_yp.c,v 1.3 1996/08/30 13:09:41 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: pw_yp.c,v 1.4 1996/08/31 01:55:33 deraadt Exp $"; #endif #endif /* not lint */ @@ -145,13 +145,16 @@ pw_yp(pw, uid) xdr_yppasswd, &yppasswd, xdr_int, &status, tv); if (r) { fprintf(stderr, "%s: rpc to yppasswdd failed. %d\n", progname, r); + clnt_destroy(client); return(0); } else if (status) { printf("Couldn't change YP password information.\n"); + clnt_destroy(client); return(0); } printf("The YP password information has been changed on %s, the master YP passwd server.\n", master); + clnt_destroy(client); return(1); } |