diff options
author | harti <harti@FreeBSD.org> | 2004-12-08 16:28:53 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2004-12-08 16:28:53 +0000 |
commit | debc54781641b995b46b1fc3c2049772e2f6c276 (patch) | |
tree | d7a98c1a68b66aa638b825a9bd039225968c92c6 /usr.bin | |
parent | bcb1f1f6f57e4630d36245b7c5fb2ce234218041 (diff) | |
download | FreeBSD-src-debc54781641b995b46b1fc3c2049772e2f6c276.zip FreeBSD-src-debc54781641b995b46b1fc3c2049772e2f6c276.tar.gz |
Don't free the second list in Lst_Concat for LST_CONCLINK; free it
in the caller instead.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/make/lst.lib/lstConcat.c | 3 | ||||
-rw-r--r-- | usr.bin/make/suff.c | 3 |
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); } /*- |