summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2011-08-25 14:35:01 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-03-20 15:25:54 +0100
commit40c06459e51401b94569196618551c65d0d36f97 (patch)
tree3c7080ce680139bf2c09a79a6e433798c9a5a678
parent4f60889f23fc710f4266bee9e455bc08d3695323 (diff)
fix memory leak in error path
Issue found by the Coverity scanner
-rw-r--r--common/lines.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/lines.c b/common/lines.c
index 8731fb7..e2349e8 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);
}