jordansissel / xdotool

fake keyboard/mouse input, window management, and more
Other
3.26k stars 319 forks source link

xdo_new to xdo_free leaks #189

Open luxe opened 7 years ago

luxe commented 7 years ago
extern "C" {
#include <xdo.h>
}

int main(){
    xdo_t *xdo = xdo_new(NULL);
    xdo_free(xdo);
}
==14950==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 72 byte(s) in 1 object(s) allocated from:
    #0 0x7fb13b18d130 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc7130)
    #1 0x7fb1381338a0 in XkbGetMap (/usr/lib/x86_64-linux-gnu/libX11.so.6+0x8d8a0)

SUMMARY: AddressSanitizer: 72 byte(s) leaked in 1 allocation(s).

Seriously?

luxe commented 7 years ago

https://github.com/jordansissel/xdotool/pull/190 fixes my leak. I dunno if its a valid or not.
stolen from:
https://github.com/kupferlauncher/keybinder/pull/10/commits/d9f0a1ff32050683300e2b981aeaab18d5d34041

frobware commented 5 years ago

Fixed by PR #242

lucasturci commented 1 year ago

Was the fix abandoned?

frobware commented 1 year ago

Was the fix abandoned?

I closed my PR due to lack of interest: https://github.com/jordansissel/xdotool/pull/242#issuecomment-631511187