Don't free the second list in Lst_Concat for LST_CONCLINK; free it
in the caller instead.
This commit is contained in:
parent
bcb1f1f6f5
commit
debc547816
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/*-
|
||||
|
Loading…
x
Reference in New Issue
Block a user