summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2006-05-20 05:47:18 +0000
committerdelphij <delphij@FreeBSD.org>2006-05-20 05:47:18 +0000
commit8de9dd8dacce13ae8fa914a10c1d71e8d9b22fd4 (patch)
tree622a12cb115b42f4e2c7191d6d04e945d539c962 /sbin
parent24beec77e1f7f0e6be2203c84c3b8f92e9ac9379 (diff)
downloadFreeBSD-src-8de9dd8dacce13ae8fa914a10c1d71e8d9b22fd4.zip
FreeBSD-src-8de9dd8dacce13ae8fa914a10c1d71e8d9b22fd4.tar.gz
do_file() is called recursively from several places and cannot
safely free() anything related to items that may be recursed on. Obtained from: DragonFly (rev 1.7, dillon) PR: bin/94767 MFC After: 1 month
Diffstat (limited to 'sbin')
-rw-r--r--sbin/rcorder/rcorder.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sbin/rcorder/rcorder.c b/sbin/rcorder/rcorder.c
index 14a7707..5bf60cb 100644
--- a/sbin/rcorder/rcorder.c
+++ b/sbin/rcorder/rcorder.c
@@ -722,6 +722,10 @@ keep_ok(fnode)
* is ok, we loop over the filenodes requirements, calling satisfy_req()
* for each of them.. once we have done this, remove this filenode
* from each provision table, as we are now done.
+ *
+ * NOTE: do_file() is called recursively from several places and cannot
+ * safely free() anything related to items that may be recursed on.
+ * Circular dependancies will cause problems if we do.
*/
void
do_file(fnode)
@@ -757,8 +761,10 @@ do_file(fnode)
r_tmp = r;
satisfy_req(r, fnode->filename);
r = r->next;
+#if 0
if (was_set == 0)
- free(r_tmp);
+ free(r_tmp);
+#endif
}
fnode->req_list = NULL;
@@ -797,10 +803,12 @@ do_file(fnode)
}
DPRINTF((stderr, "nuking %s\n", fnode->filename));
+#if 0
if (was_set == 0) {
free(fnode->filename);
free(fnode);
}
+#endif
}
void
OpenPOWER on IntegriCloud