From 5905ed26fa0eee6e8ab0e789aa05e7628b30e7d1 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 8 Jan 2017 18:08:17 +0100 Subject: [PATCH] inpgmod.c, INPgetMod(), bug fix, missing 'model' assignment 'model' is a return value, and must always be assigned to. NULL denotes the error case. --- src/spicelib/parser/inpgmod.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/spicelib/parser/inpgmod.c b/src/spicelib/parser/inpgmod.c index 2623ee0a6..7396074bb 100644 --- a/src/spicelib/parser/inpgmod.c +++ b/src/spicelib/parser/inpgmod.c @@ -292,7 +292,10 @@ char *INPgetMod(CKTcircuit *ckt, char *name, INPmodel ** model, INPtables * tab) if (! modtmp->INPmodfast) { /* Check if model is already defined */ error = create_model( ckt, modtmp, tab ); - if ( error ) return INPerror(error); + if ( error ) { + *model = NULL; + return INPerror(error); + } } *model = modtmp; return (NULL);