From b14e7cb04052e686aefc46b4d006782f1e367de0 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sat, 28 May 2016 16:52:50 +0200 Subject: [PATCH] sharedspice.c, remove meory leaks --- src/sharedspice.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sharedspice.c b/src/sharedspice.c index 904e09018..78be02a26 100644 --- a/src/sharedspice.c +++ b/src/sharedspice.c @@ -614,6 +614,8 @@ ngSpice_Init(SendChar* printfcn, SendStat* statusfcn, ControlledExit* ngspiceexi if (access(s, 0) == 0) inp_source(s); + + tfree(s); } #else /* ~ HAVE_PWD_H */ { @@ -1397,8 +1399,10 @@ void SetAnalyse( if (DecaPercent >= 1000){ /* Because CKTmaxStep may be smaller than 0.1%, we print only when CKTtime is large enough. */ - if (!strcmp(Analyse, "tran") && ckt && (ckt->CKTtime < ckt->CKTfinalTime - ckt->CKTmaxStep)) + if (!strcmp(Analyse, "tran") && ckt && (ckt->CKTtime < ckt->CKTfinalTime - ckt->CKTmaxStep)) { + tfree(s); return; + } sprintf( s, "--ready--"); result = statfcn(s, ng_ident, userptr); tfree(s);