NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/58887
The following reply was made to PR bin/58887; it has been noted by GNATS.
From: Jose Luis Duran <jlduran%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: bin/58887
Date: Mon, 15 Dec 2025 02:22:41 -0300
The comment on the original bug report:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192839#c7
Describes clearly what's going on.
The original naive workaround should have been to just avoid the free():
--- usr.sbin/mtree/spec.c
+++ usr.sbin/mtree/spec.c
@@ -537,7 +537,6 @@ replacenode(NODE *cur, NODE *new)
REPLACESTR(tags);
REPLACE(lineno);
REPLACE(flags);
- free(new);
}
static void
@@ -779,8 +778,7 @@ addchild(NODE *pathparent, NODE *centry)
/*
* We found a node with the same name above. Call
* replacenode(), which will either exit with an error,
- * or replace the information in the samename node and
- * free the information in the centry node.
+ * or replace the information in the samename node.
*/
replacenode(samename, centry);
if (samename == replacepos) {
Home |
Main Index |
Thread Index |
Old Index