diff options
author | christos <christos@NetBSD.org> | 2002-03-12 15:20:14 +0000 |
---|---|---|
committer | christos <christos@NetBSD.org> | 2002-03-12 15:20:14 +0000 |
commit | 05a507aaa8096771a9b90f2cc460f701d05002af (patch) | |
tree | fd9943b85c4f245672eb6b4fc878e8f3d24fdaf8 /fortune/fortune | |
parent | a1889a2eb2c5f5f957ded2f3fc338ce6567e6dd1 (diff) | |
download | bsdgames-darwin-05a507aaa8096771a9b90f2cc460f701d05002af.tar.gz bsdgames-darwin-05a507aaa8096771a9b90f2cc460f701d05002af.tar.zst bsdgames-darwin-05a507aaa8096771a9b90f2cc460f701d05002af.zip |
PR/15878: Ed Ravin: fortune all frees junk pointers. Fixed, free structure
members before freeing the structure itself.
Diffstat (limited to 'fortune/fortune')
-rw-r--r-- | fortune/fortune/fortune.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fortune/fortune/fortune.c b/fortune/fortune/fortune.c index 60df882d..c77a4b6d 100644 --- a/fortune/fortune/fortune.c +++ b/fortune/fortune/fortune.c @@ -1,4 +1,4 @@ -/* $NetBSD: fortune.c,v 1.33 2001/12/20 20:10:35 soren Exp $ */ +/* $NetBSD: fortune.c,v 1.34 2002/03/12 15:20:14 christos Exp $ */ /*- * Copyright (c) 1986, 1993 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 1993\n\ #if 0 static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: fortune.c,v 1.33 2001/12/20 20:10:35 soren Exp $"); +__RCSID("$NetBSD: fortune.c,v 1.34 2002/03/12 15:20:14 christos Exp $"); #endif #endif /* not lint */ @@ -587,11 +587,11 @@ over: { if (parent == NULL) warnx("`%s' not a fortune file or directory", path); - free((char *) fp); if (was_malloc) free(tpath); do_free(fp->datfile); do_free(fp->posfile); + free(fp); do_free(offensive); return FALSE; } |