Skip to content

Commit 7b7bd7b

Browse files
committed
Fix: memory leak in Operator::hPsi()
1 parent 451060b commit 7b7bd7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/module_hamilt/operator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Operator
7373
std::complex<double>* get_hpsi(const hpsi_info& info)const
7474
{
7575
const int nbands_range = (std::get<1>(info).range_2 - std::get<1>(info).range_1 + 1);
76-
if(this->hpsi == nullptr)
76+
if(this->hpsi != nullptr)
7777
{
7878
delete this->hpsi;
7979
}

0 commit comments

Comments
 (0)