From eb67c9c9f122e2a2e7c0f209e482db4588ee2d47 Mon Sep 17 00:00:00 2001
From: Simon Praetorius <simon.praetorius@tu-dresden.de>
Date: Sun, 8 Oct 2023 12:33:10 +0200
Subject: [PATCH] Fix error "delete  called on pointer returned from a
 mismatched allocation function"

---
 dune/istl/repartition.hh | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/dune/istl/repartition.hh b/dune/istl/repartition.hh
index c0e2c394d..ce2ced1db 100644
--- a/dune/istl/repartition.hh
+++ b/dune/istl/repartition.hh
@@ -706,10 +706,8 @@ namespace Dune
         return weight_;
       }
       void free(){
-        if(weight_!=0) {
-          delete weight_;
-          weight_=0;
-        }
+        delete[] weight_;
+        weight_ = nullptr;
       }
     private:
       Metis::idx_t* weight_;
-- 
GitLab