Memory leak in fedora 8 xorg server 1.3

Peter Harris peter.harris at opentext.com
Tue Dec 23 07:04:46 PST 2008


Barry Scott wrote:
> In miregion.c xfreeData macro: Why do a test on the size?
> Doesn't this lead to a leak of a malloc'ed block of memory?
> 
> #define xfreeData(reg) if ((reg)->data && (reg)->data->size) 
> xfree((reg)->data)

No. If the size is 0, then reg->data is miEmptyData (or the pixman
equivalent in more recent servers). This is a static global, is shared
amongst all single-rectangle regions, and can not be freed.

Peter Harris
-- 
               Open Text Connectivity Solutions Group
Peter Harris                    http://www.opentext.com/connectivity
Research and Development        Phone: +1 905 762 6001
peter.harris at opentext.com       Toll Free: 1 877 359 4866



More information about the xorg mailing list