From e1292b0c3a776dcd5e46231ffee63485f5d7521e Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 4 Dec 2010 10:59:28 +0000 Subject: [PATCH] bug fix, segmentation fault caused by `reset' when xspice used --- ChangeLog | 6 ++++++ src/xspice/mif/mifdelete.c | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ee9092a19..c14a42764 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-12-04 Robert Larice + * src/xspice/mif/mifdelete.c : + bug fix, segmentation fault caused by `reset' when xspice used + happened when MIFsetup hasn't been executed yet. + http://sourceforge.net/tracker/?func=detail&aid=3126116&group_id=38962&atid=423915 + 2010-11-28 Holger Vogt * transient noise example added diff --git a/src/xspice/mif/mifdelete.c b/src/xspice/mif/mifdelete.c index 56db26b32..87d86d5b4 100755 --- a/src/xspice/mif/mifdelete.c +++ b/src/xspice/mif/mifdelete.c @@ -136,9 +136,12 @@ MIFdelete( for(k = 0; k < num_conn; k++) { if((here->conn[k]->is_null) || (! here->conn[k]->is_input) ) continue; - FREE(here->conn[i]->port[j]->partial[k].port); - FREE(here->conn[i]->port[j]->ac_gain[k].port); - FREE(here->conn[i]->port[j]->smp_data.input[k].port); + if(here->conn[i]->port[j]->partial) + FREE(here->conn[i]->port[j]->partial[k].port); + if(here->conn[i]->port[j]->ac_gain) + FREE(here->conn[i]->port[j]->ac_gain[k].port); + if(here->conn[i]->port[j]->smp_data.input) + FREE(here->conn[i]->port[j]->smp_data.input[k].port); } FREE(here->conn[i]->port[j]->partial); FREE(here->conn[i]->port[j]->ac_gain);