From 1208f3dd5ed42420919371c2d3fc5b9285d3d15d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 30 Aug 2024 22:51:31 -0400 Subject: [PATCH] replace bogus allocation --- src/ML-QUIP/pair_quip.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ML-QUIP/pair_quip.cpp b/src/ML-QUIP/pair_quip.cpp index a2de4bf38a..9d18d6bad9 100644 --- a/src/ML-QUIP/pair_quip.cpp +++ b/src/ML-QUIP/pair_quip.cpp @@ -286,7 +286,7 @@ void PairQUIP::coeff(int narg, char **arg) // and returns the necessary size of quip_potential. This behavior // is invoked by setting n_potential_quip to 0. n_quip_potential = 0; - quip_potential = new int[0]; + quip_potential = new int[1]; quip_lammps_potential_initialise(quip_potential, &n_quip_potential, &cutoff, quip_file, &n_quip_file, quip_string, &n_quip_string); delete[] quip_potential; @@ -295,6 +295,7 @@ void PairQUIP::coeff(int narg, char **arg) // the location of the previously initialised potential to the quip_potential // variable, and we will use it as a handle when calling the actual calculation // routine. We return the cutoff as well. + delete[] quip_potential; quip_potential = new int[n_quip_potential]; quip_lammps_potential_initialise(quip_potential, &n_quip_potential, &cutoff, quip_file, &n_quip_file, quip_string, &n_quip_string);