From 90f82a8ef191b0fef12ec39397577733d7d4604a Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Fri, 27 Aug 2021 17:03:11 -0400 Subject: [PATCH] memory leak --- src/REACTION/fix_bond_react.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/REACTION/fix_bond_react.cpp b/src/REACTION/fix_bond_react.cpp index 192331889d..7b891d42fe 100644 --- a/src/REACTION/fix_bond_react.cpp +++ b/src/REACTION/fix_bond_react.cpp @@ -1990,7 +1990,10 @@ int FixBondReact::check_constraints() *ptr = satisfied[i] ? '1' : '0'; } double verdict = input->variable->evaluate_boolean(evalstr); - if (verdict == 0.0) return 0; + if (verdict == 0.0) { + memory->destroy(satisfied); + return 0; + } } // let's also check chirality within 'check_constraint' @@ -2012,7 +2015,10 @@ int FixBondReact::check_constraints() } } } - if (get_chirality(my4coords) != chiral_atoms[i][1][rxnID]) return 0; + if (get_chirality(my4coords) != chiral_atoms[i][1][rxnID]) { + memory->destroy(satisfied); + return 0; + } } }