Skip to content

Commit

Permalink
Fix memory issues found by ASAN
Browse files Browse the repository at this point in the history
- alloc-dealloc mismatch
- missing deallocation of features in derived class colvarbias_abf
  • Loading branch information
jhenin committed Jan 5, 2024
1 parent f885638 commit fc86e9a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/colvarbias_abf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,10 @@ colvarbias_abf::~colvarbias_abf()
delete_if_non_null(global_czar_gradients)
delete_if_non_null(global_czar_pmf)
}
delete_if_non_null(system_force)
if (system_force) delete[] system_force;
// Need to delete here because of additional features of the derived class
// wrt colvarbias base class
delete_features();
}


Expand Down

0 comments on commit fc86e9a

Please sign in to comment.