Free more memory in constraints cleanup
authorKevin Boyd <kevin.boyd@uconn.edu>
Sun, 30 Dec 2018 00:31:52 +0000 (19:31 -0500)
committerDavid van der Spoel <spoel@xray.bmc.uu.se>
Mon, 31 Dec 2018 08:19:30 +0000 (09:19 +0100)
Plug several end-of-MD memory leaks

Change-Id: I54c73723b0b4618eb3747be36ae848fcaa015551

src/gromacs/mdlib/constr.cpp

index 0a20f8baaf0941ce8a5ab94ffc72e4afcbab6393..8fb124001a9f622fc5e082cfafb550bf4197017d 100644 (file)
@@ -1122,6 +1122,18 @@ Constraints::Impl::Impl(const gmx_mtop_t     &mtop_p,
 
 Constraints::Impl::~Impl()
 {
+    if (bSettleErrorHasOccurred != nullptr)
+    {
+        sfree(bSettleErrorHasOccurred);
+    }
+    if (vir_r_m_dr_th != nullptr)
+    {
+        sfree(vir_r_m_dr_th);
+    }
+    if (settled != nullptr)
+    {
+        settle_free(settled);
+    }
     done_lincs(lincsd);
 }