diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2011-08-25 14:35:01 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2011-08-25 14:37:08 +0200 |
commit | 4004bb37bc36600dcd25c9ad5b2c6b56ad5b549b (patch) | |
tree | 6ea036c19ee461e7140f876fedaa8fcb386afea4 | |
parent | 26623d0fab78b779363967c52d5f56d8062b136b (diff) |
fix memory leak in error path
Issue found by the Coverity scanner
-rw-r--r-- | lines.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); } |