summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2006-01-17 08:01:00 +0000
committerdougb <dougb@FreeBSD.org>2006-01-17 08:01:00 +0000
commit7c81abec73c7f3407519c6f8d20e20c2b85e0a5a (patch)
tree3423ad01e7f655f30cb7605f937db5f7d9af7423
parentbc614c3af52c9593d0a7e47c3d72f4f8079759ac (diff)
downloadFreeBSD-src-7c81abec73c7f3407519c6f8d20e20c2b85e0a5a.zip
FreeBSD-src-7c81abec73c7f3407519c6f8d20e20c2b85e0a5a.tar.gz
Fix a "free(): error: chunk is already free" under certain
circumstances that include circular dependencies. PR: bin/91789 PR submitted by: Frank Behrens <frank@pinky.sax.de> Patch submitted by: Divacky Roman <xdivac02@stud.fit.vutbr.cz>
-rw-r--r--sbin/rcorder/rcorder.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sbin/rcorder/rcorder.c b/sbin/rcorder/rcorder.c
index 4c846e8..14a7707 100644
--- a/sbin/rcorder/rcorder.c
+++ b/sbin/rcorder/rcorder.c
@@ -1,4 +1,6 @@
+# if 0
/* $NetBSD: rcorder.c,v 1.7 2000/08/04 07:33:55 enami Exp $ */
+#endif
/*
* Copyright (c) 1998, 1999 Matthew R. Green
@@ -34,6 +36,8 @@
*/
#include <sys/types.h>
+__FBSDID("$FreeBSD$");
+
#include <sys/stat.h>
#include <err.h>
@@ -753,7 +757,8 @@ do_file(fnode)
r_tmp = r;
satisfy_req(r, fnode->filename);
r = r->next;
- free(r_tmp);
+ if (was_set == 0)
+ free(r_tmp);
}
fnode->req_list = NULL;
@@ -792,8 +797,10 @@ do_file(fnode)
}
DPRINTF((stderr, "nuking %s\n", fnode->filename));
- free(fnode->filename);
- free(fnode);
+ if (was_set == 0) {
+ free(fnode->filename);
+ free(fnode);
+ }
}
void
OpenPOWER on IntegriCloud