From b3140515dd3b56ca9f4fad897a66e290a76071e4 Mon Sep 17 00:00:00 2001 From: Emil Briggs <290825+elbriggs@users.noreply.github.com> Date: Fri, 27 Jan 2023 15:53:15 -0500 Subject: [PATCH] Fix possible memory leak. --- RMG/Common/GetAugRho.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RMG/Common/GetAugRho.cpp b/RMG/Common/GetAugRho.cpp index 28f6b7e89..ee6115ee0 100644 --- a/RMG/Common/GetAugRho.cpp +++ b/RMG/Common/GetAugRho.cpp @@ -57,10 +57,11 @@ template void GetAugRho(Kpoint **Kpts, double int factor = ct.noncoll_factor * ct.noncoll_factor; for(int idx = 0;idx < pbasis*factor;idx++) augrho[idx] = 0.0; + if(ct.norm_conserving_pp) return; + double *taugrho = new double[pbasis*factor](); - if(ct.norm_conserving_pp) return; std::complex *product = new std::complex[max_product * factor]; std::complex *product_tem = new std::complex[max_product * factor];