Skip to content

Fix leaks in atk_bridge_adaptor_init when D-Bus connection fails

correctmost requested to merge correctmost/at-spi2-core:cm/fix-init-leaks into main

Description

I accidentally introduced a bug into a local build of D-Bus and noticed some leaks while testing the changes.

Leak report

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x71cc898fd891 in malloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:69
    #1 0x71cc856b950d in g_malloc glib/gmem.c:100
    #2 0x71cc80d490ae in g_strdup_inline glib/gstrfuncs.h:317
    #3 0x71cc80d490ae in atk_bridge_adaptor_init atk-adaptor/bridge.c:1107
    #4 0x71cc880254ec in _gtk_accessibility_init gtk/a11y/gtkaccessibility.c:990
    #5 0x71cc87bf5865 in default_display_notify_cb gtk/gtkmain.c:715
[...snip...]

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x71cc898fd891 in malloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:69
    #1 0x71cc856b950d in g_malloc glib/gmem.c:100
    #2 0x71cc80d4911f in g_strdup_inline glib/gstrfuncs.h:317
    #3 0x71cc80d4911f in atk_bridge_adaptor_init atk-adaptor/bridge.c:1108
    #4 0x71cc880254ec in _gtk_accessibility_init gtk/a11y/gtkaccessibility.c:990
    #5 0x71cc87bf5865 in default_display_notify_cb gtk/gtkmain.c:715
[...snip...]

Testing

  • No issues were detected when testing the patch with UBSan, LSan, and ASan

Merge request reports

Loading