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:
Bård Skaflestad 2014-04-10 12:25:28 +02:00
parent fdca5404b7
commit 1cbffa09de

View File

@ -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));
}