mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-08-29 17:39:28 +02:00
freeMagic1() idiom insertion at all sites reported by static code analysis
This commit is contained in:
+21
-9
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user