From 05a507aaa8096771a9b90f2cc460f701d05002af Mon Sep 17 00:00:00 2001 From: christos Date: Tue, 12 Mar 2002 15:20:14 +0000 Subject: PR/15878: Ed Ravin: fortune all frees junk pointers. Fixed, free structure members before freeing the structure itself. --- fortune/fortune/fortune.c | 6 +++--- 1 file 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; } -- cgit v1.2.3