[Spice-devel] [spice-common 5/8] mi: fix memory leak in miFillUniqueSpanGroup

Christophe Fergeau cfergeau at redhat.com
Mon Jan 6 03:22:11 PST 2014


This is based off the corresponding xserver commit from Tiago Vignatti:
http://cgit.freedesktop.org/xorg/xserver/commit/mi/mispans.c?id=7ae46b69ba3f05f46529131e6a864904967cde3a

Since xrealloc is #defined to spice_realloc which aborts on failure, this
block is dead code, but I prefer to stay as close as possible to the
upstream xserver code this is based on.
---
 common/lines.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/lines.c b/common/lines.c
index adf1479..5b26662 100644
--- a/common/lines.c
+++ b/common/lines.c
@@ -814,6 +814,8 @@ miFillUniqueSpanGroup (GCPtr pGC, SpanGroup * spanGroup, Boolean foreground)
                             }
                             xfree (yspans);
                             xfree (ysizes);
+                            xfree (newpoints);
+                            xfree (newwidths);
                             miDisposeSpanGroup (spanGroup);
                             return;
                         }
-- 
1.8.4.2



More information about the Spice-devel mailing list