[PATCH v2 evdev 0/3] Memory leak fixes.

Rami Ylimäki rami.ylimaki at vincit.fi
Tue Mar 8 01:23:44 PST 2011


v2:

XKB options are now released with XkbFreeRMLVOSet.

The first version of these patches assigned a dynamically allocated
device filename to a const pointer. Calling free with this pointer
causes a warning, but this warning was suppressed by casting its
constness away when calling free. The warning could be alternatively
avoided by not using a const pointers in the first place.

In my opinion, using const pointer in this case is completely
fine. Removing the constness just because the string is dynamically
allocated isn't necessary. Therefore I prefer keeping the cast instead
of removing the constness of device filename string.

However, patch 3 of this series can be squashed with the 2nd patch to
remove the constness. Otherwise the 3rd patch could be just dropped.

Rami Ylimäki (3):
  Release leaked XKB options on input device disconnect.
  Release leaked device identifier on input device disconnect.
  Remove constness of device filename to avoid warning when freed.

 src/evdev.c |   19 +++++++++++++++++--
 src/evdev.h |    2 +-
 2 files changed, 18 insertions(+), 3 deletions(-)



More information about the xorg-devel mailing list