diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2014-01-22 09:45:22 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2014-01-22 09:45:22 +0000 |
commit | cd7e0bdff2553f1341a215c9b68a76a7f98324af (patch) | |
tree | 94b772b90fa51d00fc1683b60bbebf5ad4555850 /usr.bin | |
parent | 4d46856ac11d865585832884e84980c7fb1db6e0 (diff) |
fix an fd leak
ok krw@ deraadt@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/unvis/unvis.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/unvis/unvis.c b/usr.bin/unvis/unvis.c index 355a19b5676..c5cd0087fc7 100644 --- a/usr.bin/unvis/unvis.c +++ b/usr.bin/unvis/unvis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unvis.c,v 1.11 2013/11/27 13:32:02 okan Exp $ */ +/* $OpenBSD: unvis.c,v 1.12 2014/01/22 09:45:21 jsg Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -55,9 +55,10 @@ main(int argc, char *argv[]) if (*argv) while (*argv) { - if ((fp=fopen(*argv, "r")) != NULL) + if ((fp=fopen(*argv, "r")) != NULL) { process(fp, *argv); - else + fclose(fp); + } else warn("%s", *argv); argv++; } |