From dad80811f9e02f27d57a9892dd1d00fddf5171d3 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sun, 29 Sep 2013 22:16:23 +0200 Subject: [PATCH] inp2m.c: plug memory leak --- src/spicelib/parser/inp2m.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/spicelib/parser/inp2m.c b/src/spicelib/parser/inp2m.c index 204928b41..056366f62 100644 --- a/src/spicelib/parser/inp2m.c +++ b/src/spicelib/parser/inp2m.c @@ -198,8 +198,13 @@ INP2M (CKTcircuit *ckt, INPtables * tab, card * current) err_msg = INPgetMod (ckt, model, &thismodel, tab); if ( thismodel == NULL ) { INPgetModBin( ckt, model, &thismodel, tab, save ); - if ( thismodel == NULL ) current->error = err_msg; + if ( thismodel == NULL ) + current->error = err_msg; + else + tfree(err_msg); } + else + tfree(err_msg); if (thismodel != NULL) { if (thismodel->INPmodType != INPtypelook ("Mos1")