mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-30 17:49:02 +00:00
fix memory leak in error path
Issue found by the Coverity scanner
This commit is contained in:
parent
2abd83c203
commit
a09052b83c
@ -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);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user