Rationale: All the other code treats XkbSLI_IsDefault as a situation where names and maps are standard and therefore not copied (and freed). The logic in this case is inverted. Patch included. Valgrind output: ==15856== 253,664 bytes in 595 blocks are indirectly lost in loss record 270 of 273 ==15856== at 0x4C248AD: malloc (vg_replace_malloc.c:207) ==15856== by 0x44BE85: Xcalloc (utils.c:1091) ==15856== by 0x4EC881: XkbCopySrvLedInfo (xkbLEDs.c:647) ==15856== by 0x4D5BC6: DeepCopyDeviceClasses (exevents.c:253) ==15856== by 0x4D6A88: UpdateDeviceState (exevents.c:693) ==15856== by 0x4D6ECA: ProcessOtherEvent (exevents.c:925) ==15856== by 0x4FD42E: ProcessKeyboardEvent (xkbPrKeyEv.c:181) ==15856== by 0x443B68: mieqProcessDeviceEvent (mieq.c:367) ==15856== by 0x443C40: mieqProcessInputEvents (mieq.c:427) ==15856== by 0x451218: ProcessInputEvents (xf86Events.c:177) ==15856== by 0x4821A0: Dispatch (dispatch.c:354) ==15856== by 0x427AEC: main (main.c:395)
Created attachment 24059 [details] [review] Invert logic. Patch that fixes leak.
Could you put that rationale in the commit message? That's what it's for.
I made the patch before writing the bug, so that's why it wasn't in there.
Pushed as d698e62690e0a52fa537f1cd792cab7a5b1bafdf, thanks for the patch.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.