mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-30 11:06:55 -06:00
Fix memory leak
Function GridManager::createGrdecl() generally allocates memory
(using std::malloc()) for the MAPAXES keyword data output of the
'grdecl' structure. Release those resources before leaving the
scope to prevent memory leak introduced in commit fdca540
.
This commit is contained in:
parent
fdca5404b7
commit
1cbffa09de
@ -73,6 +73,7 @@
|
||||
|
||||
#include <memory>
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <numeric>
|
||||
@ -130,6 +131,8 @@ try
|
||||
GridManager::createGrdecl(newParserDeck, g);
|
||||
|
||||
grid->processEclipseFormat(g, 2e-12, false);
|
||||
|
||||
std::free(const_cast<double*>(g.mapaxes));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user