[cairo] libpixman leak (fwd)

Soeren Sandmann sandmann at daimi.au.dk
Thu Apr 24 13:40:10 PDT 2008


Soeren Sandmann <sandmann at daimi.au.dk> writes:

> > So each time pixman_rect_alloc() is called with n = 0, we leak
> > a memory block of sizeof(pixman_region16_data_t).
> 
> I guess one question is, when do we call pixman_rect_alloc() with n ==
> 0? Looking over the code, it looks like most places are careful to not
> allocate if the number of rectangles are n.

I see now where the confusion comes from. The leak in question was
fixed earlier with this commit in cairo 1.4:

commit e7fe79aafe0c0be7badbb659442c2f834fbea9f3
Author: Jan Slupski <jslupski at juljas.net>
Date:   Fri Feb 15 00:55:30 2008 +0100

    Fix for a memory leak in pixman.
    
    Port of a 1.6 fix for a memory leak in
    pixman_region_init_rects/pixman_rect_alloc
    when the count of boxes is 0.

and this one

commit dc7c047d1c68f343b66e81d9e79084e4171e2634
Author: Vladimir Vukicevic <vladimir at pobox.com>
Date:   Mon Sep 10 15:20:44 2007 -0700

    [memlk] don't try to allocate new data for 0-rectangle regions

in the standalone pixman.

So I think this leak has already been fixed.



Soren


More information about the cairo mailing list