freeMagic1() additions

These additional uses of freeMagic() also require defer-by-one using stack
storage (not global storage idiom, recently introduced).
Not sure if they were missed original or new/modified code in the past
12 months.  Some areas/line-of-code are not usually compiled, maybe that
is why they were originally missed.
This commit is contained in:
Darryl L. Miles
2025-12-22 09:57:42 -05:00
committed by R. Timothy Edwards
parent 5e8a3f038a
commit 3b4d66e7d7
4 changed files with 17 additions and 5 deletions
+3 -1
View File
@@ -95,6 +95,7 @@ extOutputGeneratedLabels(parentUse, f)
parentDef = parentUse->cu_def;
free_magic1_t mm1 = freeMagic1_init();
while ((lab = parentDef->cd_labels) != NULL)
{
if ((lab->lab_flags & LABEL_GENERATE) == 0) return;
@@ -106,9 +107,10 @@ extOutputGeneratedLabels(parentUse, f)
for (n = 0; n < ExtCurStyle->exts_numResistClasses; n++)
fprintf(f, " 0 0");
putc('\n', f);
freeMagic(lab);
freeMagic1(&mm1, lab);
parentDef->cd_labels = lab->lab_next;
}
freeMagic1_end(&mm1);
}
#endif
+5 -1
View File
@@ -2776,8 +2776,12 @@ extOutputDevices(def, transList, outFile)
/* Free the lists */
for (i = 0; i < n; i++)
{
free_magic1_t mm1 = freeMagic1_init();
for (lb = extSpecialBounds[i]; lb != NULL; lb = lb->b_next)
freeMagic((char *)lb);
freeMagic1(&mm1, (char *)lb);
freeMagic1_end(&mm1);
}
freeMagic((char *)extSpecialBounds);
/* Put the region list back the way we found it: */