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.hutte...@who-t.net>
---
 src/wcmValidateDevice.c | 12 +++++++-----
 1 file 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;
 }
 
-- 
1.8.1.4


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to