summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2011-08-25 14:35:01 +0200
committerHans de Goede <hdegoede@redhat.com>2011-08-25 14:37:08 +0200
commita09052b83cf4003b5eb5d486e498e8bc70e8262f (patch)
treed34c9c10dbc6a27cfdee9bc47939fbd912ebda54 /common
parent2abd83c203ed7363b8c762dd4affa9835ca6dfca (diff)
downloadspice-a09052b83cf4003b5eb5d486e498e8bc70e8262f.tar.gz
spice-a09052b83cf4003b5eb5d486e498e8bc70e8262f.tar.xz
spice-a09052b83cf4003b5eb5d486e498e8bc70e8262f.zip
fix memory leak in error path
Issue found by the Coverity scanner
Diffstat (limited to 'common')
-rw-r--r--common/lines.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/lines.c b/common/lines.c
index 8731fb7e..e2349e82 100644
--- a/common/lines.c
+++ b/common/lines.c
@@ -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);
}