diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-05-09 10:55:33 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-05-09 11:45:53 +1000 |
commit | dff311a44c13687c12e86d8233f15bb0f8868361 (patch) | |
tree | 780f2f21cc88548c3427b2fbf1c1a7147fbf2a07 | |
parent | bc095d579bc6b1380080c83c4e5f6df173364b76 (diff) | |
download | xf86-input-wacom-dff311a44c13687c12e86d8233f15bb0f8868361.tar.gz |
Free duplicated option list after conversion to InputOption
The duplicated list is a copy (as the comment in the server says) and thus
must be freed.
==27895== 947 (40 direct, 907 indirect) bytes in 1 blocks are definitely lost in loss record 266 of 311
==27895== at 0x4A06B6F: calloc (vg_replace_malloc.c:593)
==27895== by 0x4E538C: addNewOption2 (Flags.c:203)
==27895== by 0x4E5401: xf86addNewOption (Flags.c:216)
==27895== by 0x4AEB24: xf86AddNewOption (xf86Option.c:347)
==27895== by 0x4AE54B: xf86OptionListDuplicate (xf86Option.c:152)
==27895== by 0xB74D139: wcmOptionDupConvert (wcmValidateDevice.c:382)
==27895== by 0xB74D408: wcmQueueHotplug (wcmValidateDevice.c:515)
==27895== by 0xB74D645: wcmHotplugOthers (wcmValidateDevice.c:568)
==27895== by 0xB742DA2: wcmPreInit (wcmConfig.c:599)
==27895== by 0x4C1ACF: xf86NewInputDevice (xf86Xinput.c:846)
==27895== by 0x4C2014: NewInputDeviceRequest (xf86Xinput.c:989)
==27895== by 0x4DD72C: device_added (udev.c:231)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
-rw-r--r-- | src/wcmValidateDevice.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c index 4e8289b..af3b153 100644 --- a/src/wcmValidateDevice.c +++ b/src/wcmValidateDevice.c @@ -375,7 +375,7 @@ static InputOption *wcmOptionDupConvert(InputInfoPtr pInfo, const char* basename WacomToolPtr ser = common->serials; InputOption *iopts = NULL; char *name; - pointer options; + pointer options, o; int rc; #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12 @@ -413,13 +413,15 @@ static InputOption *wcmOptionDupConvert(InputInfoPtr pInfo, const char* basename free(name); - while(options) + o = options; + while(o) { iopts = input_option_new(iopts, - xf86OptionName(options), - xf86OptionValue(options)); - options = xf86NextOption(options); + xf86OptionName(o), + xf86OptionValue(o)); + o = xf86NextOption(o); } + xf86OptionListFree(options); return iopts; } |