diff options
author | 2014-01-22 09:45:21 +0000 | |
---|---|---|
committer | 2014-01-22 09:45:21 +0000 | |
commit | 7def82c92495092c57ec5797d5ffca39e04415ae (patch) | |
tree | 5188fae655b6f6ca1d7833e3762724ff75aa4ce7 | |
parent | fix fd leaks in error paths (diff) | |
download | wireguard-openbsd-7def82c92495092c57ec5797d5ffca39e04415ae.tar.xz wireguard-openbsd-7def82c92495092c57ec5797d5ffca39e04415ae.zip |
fix an fd leak
ok krw@ deraadt@
-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++; } |