[cairo-commit] src/cairo-quartz-surface.c

Brian Ewins brianewins at kemper.freedesktop.org
Tue Nov 13 18:07:48 PST 2007


 src/cairo-quartz-surface.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit bcb0f57e5eca58480e24251777f0b967e1aadefe
Author: Brian Ewins <Brian.Ewins at gmail.com>
Date:   Wed Nov 14 01:50:34 2007 +0000

    [quartz] remove double malloc in dashing code.
    
    fdash is reallocated without being released, and is
    allocated at the wrong size too.

diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index d6c2ca7..9c3014c 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -1355,13 +1355,10 @@ _cairo_quartz_surface_stroke (void *abstract_surface,
 	if (style->num_dashes%2)
 	    max_dashes *= 2;
 	if (max_dashes > STATIC_DASH)
-	    fdash = _cairo_malloc_ab (style->num_dashes, sizeof (float));
+	    fdash = _cairo_malloc_ab (max_dashes, sizeof (float));
 	if (fdash == NULL)
 	    return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 
-	if (max_dashes > STATIC_DASH)
-	    fdash = malloc (sizeof(float)*max_dashes);
-
 	for (k = 0; k < max_dashes; k++)
 	    fdash[k] = (float) style->dash[k % style->num_dashes];
 	


More information about the cairo-commit mailing list