summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/make/lst.lib/lstConcat.c3
-rw-r--r--usr.bin/make/suff.c3
2 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/make/lst.lib/lstConcat.c b/usr.bin/make/lst.lib/lstConcat.c
index 766cb44..45d5b89 100644
--- a/usr.bin/make/lst.lib/lstConcat.c
+++ b/usr.bin/make/lst.lib/lstConcat.c
@@ -56,8 +56,6 @@ __FBSDID("$FreeBSD$");
* elements, if specified, but the elements themselves are not copied.
* If the elements should be duplicated to avoid confusion with another
* list, the Lst_Duplicate function should be called first.
- * If LST_CONCLINK is specified, the second list is destroyed since
- * its pointers have been corrupted and the list is no longer useable.
*
* Results:
* SUCCESS if all went well. FAILURE otherwise.
@@ -110,7 +108,6 @@ Lst_Concat(Lst *list1, Lst *list2, int flags)
}
list1->lastPtr = list2->lastPtr;
}
- free(list2);
} else if (list2->firstPtr != NULL) {
/*
* We set the nextPtr of the last element of list 2 to be NULL to make
diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c
index 4802f2b..b08bc10 100644
--- a/usr.bin/make/suff.c
+++ b/usr.bin/make/suff.c
@@ -454,6 +454,7 @@ Suff_ClearSuffixes(void)
{
Lst_Concat(suffClean, sufflist, LST_CONCLINK);
+ free(sufflist);
sufflist = Lst_Init();
sNum = 1;
suffNull = emptySuff;
@@ -2079,6 +2080,8 @@ sfnd_return:
Lst_Concat(slst, srcs, LST_CONCLINK);
Lst_Concat(slst, targs, LST_CONCLINK);
+ free(srcs);
+ free(targs);
}
/*-
OpenPOWER on IntegriCloud