diff --git a/src/frontend/inpc_probe.c b/src/frontend/inpc_probe.c index 99c4bcc5d..600ee1913 100644 --- a/src/frontend/inpc_probe.c +++ b/src/frontend/inpc_probe.c @@ -48,6 +48,7 @@ void inp_probe(struct card* deck) int skip_control = 0; int skip_subckt = 0; wordlist* probes = NULL, *probeparams = NULL, *wltmp, *allsaves = NULL; + wordlist *next_wl = NULL; bool haveall = FALSE, havedifferential = FALSE, t = TRUE, havesave = FALSE; NGHASHPTR instances; /* instance hash table */ int ee = 0; /* serial number for sources */ @@ -140,7 +141,12 @@ void inp_probe(struct card* deck) } } /* don't free the wl_word, they belong to the cards */ - tfree(probes); + wltmp = probes; + while (wltmp) { + next_wl = wltmp->wl_next; + tfree(wltmp); // Do not free the wl_word + wltmp = next_wl; + } /* Set up the hash table for all instances (instance name is key, data is the storage location of the card) */ @@ -188,6 +194,7 @@ void inp_probe(struct card* deck) if (!instname) continue; nghash_insert(instances, instname, card); + tfree(instname); } if (haveall || probeparams == NULL) { @@ -882,6 +889,7 @@ void inp_probe(struct card* deck) tmpcard = nghash_find(instances, instname); if (!tmpcard) { fprintf(stderr, "Warning: Could not find the instance line for %s,\n .probe %s will be ignored\n", instname, wltmp->wl_word); + tfree(instname); continue; } char* thisline = tmpcard->line; @@ -917,6 +925,7 @@ void inp_probe(struct card* deck) else if (err == 3) { fprintf(stderr, "Warning: Number of nodes mismatch,\n .probe %s will be ignored\n", wltmp->wl_word); } + tfree(instname); continue; } else if (!haveall) { @@ -934,6 +943,9 @@ void inp_probe(struct card* deck) } } + if (probeparams) { + wl_free(probeparams); + } nghash_free(instances, NULL, NULL); } diff --git a/src/xspice/enh/enhtrans.c b/src/xspice/enh/enhtrans.c index 2eb23aa2a..649724748 100644 --- a/src/xspice/enh/enhtrans.c +++ b/src/xspice/enh/enhtrans.c @@ -124,8 +124,8 @@ ENHtranslate_poly( l1->linenum = d->linenum; l2->linenum = d->linenum; - l1->linesource = copy("internal"); - l2->linesource = copy("internal"); + l1->linesource = "internal"; + l2->linesource = "internal"; /* Create the translated cards */ d->error = two2three_translate(d->line, &(l1->line), &(l2->line));