[PATCH] xfree86: fix a memory leak in edidMakeAtom().
Michel Dänzer
michel at daenzer.net
Tue Dec 15 19:29:00 PST 2015
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 <leo.liu at amd.com>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
[...]
> @@ -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 <michel.daenzer at amd.com>
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the xorg-devel
mailing list