summaryrefslogtreecommitdiff
path: root/games/fortune
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>2001-03-22 22:29:41 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>2001-03-22 22:29:41 +0000
commit67578738f93eefd0d637d8126b4ff271895ed583 (patch)
treed031ee334c794bab9f7a9936085bb030aef4a898 /games/fortune
parentfebc1a83b3ef36d44dedd4f7f7973ff0edf05993 (diff)
Don't free what wasn't alloced. Found by niels.
Diffstat (limited to 'games/fortune')
-rw-r--r--games/fortune/fortune/fortune.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/games/fortune/fortune/fortune.c b/games/fortune/fortune/fortune.c
index ad31f764259..cf222d931d8 100644
--- a/games/fortune/fortune/fortune.c
+++ b/games/fortune/fortune/fortune.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fortune.c,v 1.9 2001/01/28 23:41:40 niklas Exp $ */
+/* $OpenBSD: fortune.c,v 1.10 2001/03/22 22:29:40 pjanzen Exp $ */
/* $NetBSD: fortune.c,v 1.8 1995/03/23 08:28:40 cgd Exp $ */
/*-
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: fortune.c,v 1.9 2001/01/28 23:41:40 niklas Exp $";
+static char rcsid[] = "$OpenBSD: fortune.c,v 1.10 2001/03/22 22:29:40 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -481,12 +481,12 @@ FILEDESC *parent;
if (!isdir && parent == NULL && (All_forts || Offend) &&
!is_off_name(path)) {
offensive = off_name(path);
- was_malloc = TRUE;
if (Offend) {
if (was_malloc)
free(path);
path = offensive;
file = off_name(file);
+ was_malloc = TRUE;
}
}