diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2003-09-05 03:28:28 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2003-09-05 03:28:28 +0000 |
commit | 41ce37856c9eb7836885320f6f353445159dd59b (patch) | |
tree | 915719876c6c881431c705881b69e8ccbc7d7006 /usr.bin | |
parent | 0338a936ef629f18c740c1ee461b35e1605eac87 (diff) |
fp leak. from Patrick Latifi. ok beck@ deraadt@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/sup/src/supcparse.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/sup/src/supcparse.c b/usr.bin/sup/src/supcparse.c index c4ec08fd8b6..1820b0ace39 100644 --- a/usr.bin/sup/src/supcparse.c +++ b/usr.bin/sup/src/supcparse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: supcparse.c,v 1.8 2002/02/16 21:27:54 millert Exp $ */ +/* $OpenBSD: supcparse.c,v 1.9 2003/09/05 03:28:27 tedu Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -266,8 +266,10 @@ putwhen(fname, tstamp) FILE *fp; if ((fp = fopen(fname, "w")) == NULL) return (0); - if (fprintf(fp, "%u\n", tstamp) < 0) + if (fprintf(fp, "%u\n", tstamp) < 0) { + (void) fclose(fp); return (0); + } if (fclose(fp) != 0) return (0); return (1); |