From a3daeb9c45b9cb357334f57f75bedb1aa72c1c60 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Thu, 17 Oct 2019 18:36:56 +0200 Subject: [PATCH] Fix memory error during EclipseGrid creation with Actnum. We pass an int pointer to the function initCornerPointGrid. With ACTNUM this pointer was initialized with data pointer of an int vector that we threw away before the function call (otherwise it was null). To fix this we move the int-vector up one scope. --- src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp b/src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp index 075c23614..c69b14d6b 100644 --- a/src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp +++ b/src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp @@ -1150,10 +1150,11 @@ EclipseGrid::EclipseGrid(const Deck& deck, const int * actnum) const std::vector& coord = COORDKeyWord.getSIDoubleData(); int * actnum = nullptr; + std::vector actnumVector; if (deck.hasKeyword()) { const auto& actnumKeyword = deck.getKeyword(); - std::vector actnumVector = actnumKeyword.getIntData(); + actnumVector = actnumKeyword.getIntData(); actnum=actnumVector.data(); }