fix memory leak in error path

Issue found by the Coverity scanner
This commit is contained in:
Christophe Fergeau 2011-08-25 14:35:01 +02:00 committed by Hans de Goede
parent 26623d0fab
commit 4004bb37bc

View File

@ -1512,7 +1512,7 @@ miZeroLine (GCPtr pGC, int mode, /* Origin or Previous */
pspanInit = (DDXPointRec *)xalloc (list_len * sizeof (DDXPointRec));
pwidthInit = (int *)xalloc (list_len * sizeof (int));
if (!pspanInit || !pwidthInit)
return;
goto out;
Nspans = 0;
new_span = TRUE;
@ -1686,6 +1686,7 @@ miZeroLine (GCPtr pGC, int mode, /* Origin or Previous */
if (Nspans > 0)
(*pGC->ops->FillSpans) (pGC, Nspans, pspanInit, pwidthInit, FALSE, TRUE);
out:
xfree (pwidthInit);
xfree (pspanInit);
}