freeMagic1() idiom insertion at all sites reported by static code analysis

This commit is contained in:
Darryl L. Miles
2025-10-29 21:41:18 +00:00
parent 37287462f4
commit 9f4dd68cff
75 changed files with 621 additions and 230 deletions
+21 -9
View File
@@ -181,23 +181,35 @@ PlotPSTechInit()
/* Clear out any old information */
for (style = plotPSStyles; style != NULL; style = style->grs_next)
{
freeMagic((char *) style);
free_magic1_t mm1 = freeMagic1_init();
for (style = plotPSStyles; style != NULL; style = style->grs_next)
{
freeMagic1(&mm1, (char *) style);
}
freeMagic1_end(&mm1);
plotPSStyles = NULL;
}
plotPSStyles = NULL;
for (pattern = plotPSPatterns; pattern != NULL; pattern = pattern->pat_next)
{
freeMagic((char *) pattern);
free_magic1_t mm1 = freeMagic1_init();
for (pattern = plotPSPatterns; pattern != NULL; pattern = pattern->pat_next)
{
freeMagic1(&mm1, (char *) pattern);
}
freeMagic1_end(&mm1);
plotPSPatterns = NULL;
}
plotPSPatterns = NULL;
for (color = plotPSColors; color != NULL; color = color->col_next)
{
freeMagic((char *) color);
free_magic1_t mm1 = freeMagic1_init();
for (color = plotPSColors; color != NULL; color = color->col_next)
{
freeMagic1(&mm1, (char *) color);
}
freeMagic1_end(&mm1);
plotPSColors = NULL;
}
plotPSColors = NULL;
if (!PlotPSIdFont)
StrDup(&PlotPSIdFont, defaultFont);
+6 -2
View File
@@ -216,10 +216,12 @@ PlotVersTechInit()
{
VersatecStyle *style;
free_magic1_t mm1 = freeMagic1_init();
for (style = plotVersStyles; style != NULL; style = style->vs_next)
{
freeMagic((char *) style);
freeMagic1(&mm1, (char *) style);
}
freeMagic1_end(&mm1);
plotVersStyles = NULL;
if (PlotVersPrinter == NULL)
@@ -267,10 +269,12 @@ PlotColorVersTechInit()
{
VersatecStyle *style;
free_magic1_t mm1 = freeMagic1_init();
for (style = plotColorVersStyles; style != NULL; style = style->vs_next)
{
freeMagic((char *) style);
freeMagic1(&mm1, (char *) style);
}
freeMagic1_end(&mm1);
plotColorVersStyles = NULL;
if (PlotVersPrinter == NULL)