mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 22:43:03 +01:00
Fix deleted memory use in optimizer (#242)
In function gen_retrieval (jrd/opt.cpp) created OptimizerRetrieval and call getInversion, where created InversionCandidateList and after analyzeNavigation variable navigationCandidate linked to item of list. After clean up the list in function gen_retrieval call getNavigation where using variable navigationCandidate.
This commit is contained in:
parent
21f2b8c5ed
commit
913b9499e9
@ -384,7 +384,8 @@ OptimizerRetrieval::~OptimizerRetrieval()
|
||||
* Functional description
|
||||
*
|
||||
**************************************/
|
||||
|
||||
if (navigationCandidate)
|
||||
delete navigationCandidate;
|
||||
for (FB_SIZE_T i = 0; i < inversionCandidates.getCount(); ++i)
|
||||
delete inversionCandidates[i];
|
||||
}
|
||||
@ -522,6 +523,7 @@ InversionCandidate* OptimizerRetrieval::generateInversion()
|
||||
// Clean up inversion list
|
||||
InversionCandidate** inversion = inversions.begin();
|
||||
for (FB_SIZE_T i = 0; i < inversions.getCount(); i++)
|
||||
if (inversion[i] != navigationCandidate)
|
||||
delete inversion[i];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user