[PATCH xts] XI/ChangePointerDevice: Fix double-free

Peter Harris pharris at opentext.com
Tue Jun 11 10:40:51 PDT 2013


On 2013-06-11 05:25, Peter Hutterer wrote:
> 
> this just doesn't look right, it's a bit confusing.
> bogus is only used for the deviceid and only a problem for XCloseDevice, so
> you should be able to move the device = &bogus call down past
> XCloseDevice(). that closes the already open device and then works on the
> copy for the rest, which doesn't care about the stuff other than the device
> id.

Wouldn't that result in a double-free? (time passes) Oh, I see. xts
leaks all those XDevice pointers.

> tbh, a better change would even be to change all the future calls to
> directly use &bogus to signal that this is not a valid device anyway.

v2 incoming.

Thanks for the review.

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


More information about the xorg-devel mailing list