From 88008af088df1ba3b03dc27263a4fe78a1b18916 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 18 Aug 2019 18:26:00 +0200 Subject: [PATCH] remove memory leaks --- src/xspice/evt/evtplot.c | 4 +++- src/xspice/mif/mifdelete.c | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/xspice/evt/evtplot.c b/src/xspice/evt/evtplot.c index dcd7c5eeb..96e3b8cc2 100644 --- a/src/xspice/evt/evtplot.c +++ b/src/xspice/evt/evtplot.c @@ -142,8 +142,10 @@ struct dvec *EVTfindvec( } } - if(! found) + if(! found) { + tfree(name); return(NULL); + } /* Get the UDN type index */ udn_index = node_table[i]->udn_index; diff --git a/src/xspice/mif/mifdelete.c b/src/xspice/mif/mifdelete.c index 515c7efad..3c077d6a0 100644 --- a/src/xspice/mif/mifdelete.c +++ b/src/xspice/mif/mifdelete.c @@ -134,8 +134,11 @@ MIFdelete(GENinstance *gen_inst) } /* Free the basic port structure allocated in MIFget_port */ num_port = here->conn[i]->size; - for (j = 0; j < num_port; j++) + for (j = 0; j < num_port; j++) { + /* Memory allocated in mif_inp2.c */ + FREE(here->conn[i]->port[j]->type_str); FREE(here->conn[i]->port[j]); + } FREE(here->conn[i]->port); }