mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -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:
@@ -73,6 +73,7 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
@@ -130,6 +131,8 @@ try
|
|||||||
GridManager::createGrdecl(newParserDeck, g);
|
GridManager::createGrdecl(newParserDeck, g);
|
||||||
|
|
||||||
grid->processEclipseFormat(g, 2e-12, false);
|
grid->processEclipseFormat(g, 2e-12, false);
|
||||||
|
|
||||||
|
std::free(const_cast<double*>(g.mapaxes));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user