From 7bb8049d2aacd1607c91fb7e3ff4cdc3491211f1 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Tue, 26 Feb 2019 20:21:38 +0100 Subject: [PATCH] fix bug no. 394, reported by Yurii Demchyna --- src/xspice/mif/mif_inp2.c | 2 +- src/xspice/mif/mifsetup.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xspice/mif/mif_inp2.c b/src/xspice/mif/mif_inp2.c index a6b48e172..aa84ff97e 100644 --- a/src/xspice/mif/mif_inp2.c +++ b/src/xspice/mif/mif_inp2.c @@ -846,7 +846,7 @@ MIFget_port( /* store the port type information in the instance struct */ fast->conn[conn_num]->port[port_num]->type = def_port_type; - fast->conn[conn_num]->port[port_num]->type_str = def_port_type_str; + fast->conn[conn_num]->port[port_num]->type_str = copy(def_port_type_str); /* check for a leading tilde on digital ports */ if(*next_token_type == MIF_TILDE_TOK) { diff --git a/src/xspice/mif/mifsetup.c b/src/xspice/mif/mifsetup.c index e2672e64e..275c75f13 100644 --- a/src/xspice/mif/mifsetup.c +++ b/src/xspice/mif/mifsetup.c @@ -528,7 +528,8 @@ MIFunsetup(GENmodel *inModel,CKTcircuit *ckt) tfree(here->conn[i]->port[j]->partial); tfree(here->conn[i]->port[j]->ac_gain); tfree(here->conn[i]->port[j]->smp_data.input); - + /* free memory allocated in mif_inp2.c */ + tfree(here->conn[i]->port[j]->type_str); } /* end for number of ports */ } /* end for number of connections */ /* free memory allocated by cm_analog_alloc and cm_analog_converge */