On 11.12.2015 23:45, Leo Liu wrote:
> 
> Subject: [PATCH] xfree86: fix a memory leak in edidMakeAtom()
> 
> leak happens when looping `xrandr --prop', need free for the mallocated
> data,
> duplication of passed data to make sure free dynamic allocation inside the
> xf86RegisterRootWindowProperty().
> 
> v2: rebase
> 
> Signed-off-by: Leo Liu <[email protected]>
> Signed-off-by: Michel Dänzer <[email protected]>

[...]

> @@ -1865,7 +1866,9 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom
> property, Atom type,
>      pNewProp->type = type;
>      pNewProp->format = format;
>      pNewProp->size = len;
> -    pNewProp->data = value;
> +    if (!(pNewProp->data = (void *)malloc(len * format/8)))

malloc returns void*, so this cast is superfluous. With that removed,

Reviewed-by: Michel Dänzer <[email protected]>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to