Permalink
Browse files

Merge pull request #1246 from raimis/fix_presort

Fix memory leak and deallocation in psi::IntegralTransform::presort_so_tei
  • Loading branch information...
robertodr committed Sep 28, 2018
2 parents 2c13a1c + cb15575 commit ba98fb72ab73350a613ae96b56d1d4c6074c2ae9
Showing with 2 additions and 3 deletions.
  1. +2 −3 psi4/src/psi4/libtrans/integraltransform_sort_so_tei.cc
@@ -187,7 +187,6 @@ void IntegralTransform::presort_so_tei() {
double *aFzcOp = init_array(nTriSo_);
double *aD = init_array(nTriSo_);
double *aFock = init_array(nTriSo_);
double *aoH = init_array(nTriSo_);
double *bFzcD = aFzcD;
double *bFzcOp = aFzcOp;
double *bD = aD;
@@ -236,7 +235,7 @@ void IntegralTransform::presort_so_tei() {
*/
// H_->print();
aoH = H_->to_lower_triangle();
double *aoH = H_->to_lower_triangle();
for (int pq = 0; pq < nTriSo_; ++pq) {
aFzcOp[pq] = aoH[pq];
aFock[pq] = aoH[pq];
@@ -519,14 +518,14 @@ void IntegralTransform::presort_so_tei() {
free(aFzcD);
free(aFzcOp);
free(aD);
free(aoH);
free(aFock);
if (transformationType_ != TransformationType::Restricted) {
free(bFzcD);
free(bFzcOp);
free(bD);
free(bFock);
}
delete[] aoH;
dpd_set_default(currentActiveDPD);

0 comments on commit ba98fb7

Please sign in to comment.