[Pkg-electronics-commits] [gnucap] 21/47: fix another memory leak in map_sckt_nodes

felix salfelder felix-guest at moszumanska.debian.org
Mon Sep 26 10:36:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

felix-guest pushed a commit to branch master
in repository gnucap.

commit 32217dd5bc4fc70209391021b578c51e81e78483
Author: Felix Salfelder <felix at salfelder.org>
Date:   Fri Sep 11 12:06:55 2015 +0200

    fix another memory leak in map_sckt_nodes
    
    delete map in case of an exception.
---
 lib/e_cardlist.cc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/e_cardlist.cc b/lib/e_cardlist.cc
index 92b1c26..d46544f 100644
--- a/lib/e_cardlist.cc
+++ b/lib/e_cardlist.cc
@@ -503,7 +503,12 @@ void CARD_LIST::map_subckt_nodes(const CARD* model, const CARD* owner)
     if ((**ci).is_device()) {
       for (int ii = 0;  ii < (**ci).net_nodes();  ++ii) {
 	// for each connection node in card
-	(**ci).n_(ii).map_subckt_node(map, owner);
+	try{ untested();
+	  (**ci).n_(ii).map_subckt_node(map, owner);
+	}catch(...){ untested();
+	  delete[] map;
+	  throw;
+	}
       }
     }else{
       assert(dynamic_cast<MODEL_CARD*>(*ci));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-electronics/gnucap.git



More information about the Pkg-electronics-commits mailing list