summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjasper <jasper@openbsd.org>2011-01-03 17:38:24 +0000
committerjasper <jasper@openbsd.org>2011-01-03 17:38:24 +0000
commite216b597efb7ce396224b77397b6bc460b47d46b (patch)
tree19271b3bac75ab0ed1d9b149aa954da89ebf1242
parentuse host_flags directly as they're initialized during attach time. (diff)
downloadwireguard-openbsd-e216b597efb7ce396224b77397b6bc460b47d46b.tar.xz
wireguard-openbsd-e216b597efb7ce396224b77397b6bc460b47d46b.zip
- plug mem leak.
ok chl@
-rw-r--r--games/fortune/fortune/fortune.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/games/fortune/fortune/fortune.c b/games/fortune/fortune/fortune.c
index 7169fb74434..c919142c666 100644
--- a/games/fortune/fortune/fortune.c
+++ b/games/fortune/fortune/fortune.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fortune.c,v 1.29 2010/07/02 23:43:42 tedu Exp $ */
+/* $OpenBSD: fortune.c,v 1.30 2011/01/03 17:38:24 jasper Exp $ */
/* $NetBSD: fortune.c,v 1.8 1995/03/23 08:28:40 cgd Exp $ */
/*-
@@ -663,8 +663,10 @@ add_dir(FILEDESC *fp)
if (fp->num_children == 0) {
(void) fprintf(stderr,
"fortune: %s: No fortune files in directory.\n", fp->path);
+ closedir(dir);
return FALSE;
}
+ closedir(dir);
return TRUE;
}