mirror of
https://git.savannah.gnu.org/git/gperf.git
synced 2025-12-02 21:19:24 +00:00
Use an array-list instead of a linked-list of equiv.-classes, part 2.
* src/search.cc (Search::compute_partition): Fix a memory leak.
This commit is contained in:
@@ -1068,7 +1068,9 @@ Search::compute_partition (bool *undetermined) const
|
||||
{
|
||||
/* Allocate a new EquivalenceClass and add it as the last element to
|
||||
the partition. */
|
||||
pindex = partition->_equclasses.add_last (* new EquivalenceClass());
|
||||
char temp_storage[sizeof (EquivalenceClass)];
|
||||
EquivalenceClass * temp_equclass = new (temp_storage) EquivalenceClass ();
|
||||
pindex = partition->_equclasses.add_last (* temp_equclass);
|
||||
|
||||
/* Map this keyword (and all equivalent ones that will be seen later)
|
||||
to the equivalence class number pindex. */
|
||||
|
||||
Reference in New Issue
Block a user