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 */