diff options
author | Hartmut Brandt <harti@FreeBSD.org> | 2004-12-08 16:28:53 +0000 |
---|---|---|
committer | Hartmut Brandt <harti@FreeBSD.org> | 2004-12-08 16:28:53 +0000 |
commit | 3220c0368c97bca4fb069d997d0697acbb77a7b8 (patch) | |
tree | d7a98c1a68b66aa638b825a9bd039225968c92c6 /usr.bin | |
parent | c76d7d5047d90b7777133dd0769abbfb5d58ddbf (diff) | |
download | src-3220c0368c97bca4fb069d997d0697acbb77a7b8.tar.gz src-3220c0368c97bca4fb069d997d0697acbb77a7b8.zip |
Don't free the second list in Lst_Concat for LST_CONCLINK; free it
in the caller instead.
Notes
Notes:
svn path=/head/; revision=138565
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 766cb440ded8..45d5b89891be 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 4802f2bf0c0e..b08bc10243b9 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); } /*- |