aboutsummaryrefslogtreecommitdiff
path: root/src/evdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/evdev.c')
-rw-r--r--src/evdev.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/evdev.c b/src/evdev.c
index d133870..e4ca84e 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1235,6 +1235,7 @@ EvdevAddAbsClass(DeviceIntPtr device)
pEvdev->flags |= EVDEV_RELATIVE_MODE;
else
xf86Msg(X_INFO, "%s: unknown mode, use default\n", pInfo->name);
+ xfree(mode);
}
return Success;
@@ -1370,15 +1371,16 @@ EvdevInitButtonMapping(InputInfoPtr pInfo)
/* Check for user-defined button mapping */
if ((mapping = xf86CheckStrOption(pInfo->options, "ButtonMapping", NULL)))
{
- char *s = " ";
+ char *map, *s = " ";
int btn = 0;
xf86Msg(X_CONFIG, "%s: ButtonMapping '%s'\n", pInfo->name, mapping);
+ map = mapping;
while (s && *s != '\0' && nbuttons < EVDEV_MAXBUTTONS)
{
- btn = strtol(mapping, &s, 10);
+ btn = strtol(map, &s, 10);
- if (s == mapping || btn < 0 || btn > EVDEV_MAXBUTTONS)
+ if (s == map || btn < 0 || btn > EVDEV_MAXBUTTONS)
{
xf86Msg(X_ERROR,
"%s: ... Invalid button mapping. Using defaults\n",
@@ -1388,8 +1390,9 @@ EvdevInitButtonMapping(InputInfoPtr pInfo)
}
pEvdev->btnmap[nbuttons++] = btn;
- mapping = s;
+ map = s;
}
+ xfree(mapping);
}
for (i = nbuttons; i < ArrayLength(pEvdev->btnmap); i++)
@@ -2071,6 +2074,7 @@ EvdevPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
num_calibration = sscanf(str, "%d %d %d %d",
&calibration[0], &calibration[1],
&calibration[2], &calibration[3]);
+ xfree(str);
if (num_calibration == 4)
EvdevSetCalibration(pInfo, num_calibration, calibration);
else