From f4472f788e6c330436a9d8619de83e95ee379165 Mon Sep 17 00:00:00 2001 From: rlar Date: Mon, 4 May 2015 20:17:28 +0200 Subject: [PATCH] spicelib/parser/inpptree.c, bug fix, "#287 Shared library crashes on using non existing functions " "remcirc" has the potential to invoke INPfreeTree() with a NULL IFparseTree Thanks to Craggan, who reported this in: http://sourceforge.net/p/ngspice/bugs/287/ --- src/spicelib/parser/inpptree.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/spicelib/parser/inpptree.c b/src/spicelib/parser/inpptree.c index 0dac42703..956b190cc 100644 --- a/src/spicelib/parser/inpptree.c +++ b/src/spicelib/parser/inpptree.c @@ -1409,6 +1409,9 @@ void INPfreeTree(IFparseTree *ptree) int i; + if (!pt) + return; + for (i = 0; i < pt->p.numVars; i++) dec_usage(pt->derivs[i]);