From 2e0b8b3e348032f36410ca56e7325fd97b9b1ded Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 23 May 2018 23:08:44 +0200 Subject: [PATCH] plug a small memory leak --- src/frontend/inpcom.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 4713c3df5..a7fadad13 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -6951,8 +6951,10 @@ pspice_compat(struct card *oldcard) card->line = str = inp_remove_ws(card->line); str = nexttok(str); /* throw away '.model' */ INPgetNetTok(&str, &modname, 0); /* model name */ - if (!ciprefix("vswitch", str)) + if (!ciprefix("vswitch", str)) { + tfree(modname); continue; + } /* we have to find 4 parameters, identified by '=', separated by spaces */ char *equalptr[4]; equalptr[0] = strstr(str, "="); @@ -6989,6 +6991,7 @@ pspice_compat(struct card *oldcard) modelsfound = insert_new_model(modelsfound, modname, subcktline->line); else modelsfound = insert_new_model(modelsfound, modname, "top"); + tfree(modname); } } /* second scan: find the switch instances s calling a vswitch model and transform them */