Skip to content

Fix icon-name leaks in thunar_window_view_switcher_update

correctmost requested to merge correctmost/thunar:cm/fix-icon-leaks into master

Example leak report

Direct leak of 22 byte(s) in 1 object(s) allocated from:
    #0 0x5aa572af71e9 in malloc (/usr/local/bin/thunar+0x4571e9) (BuildId: 06b9a2d62ac0c5ef)
    #1 0x753570a5ce4a in g_malloc /usr/src/debug/glib2/build/../glib/glib/gmem.c:100:13
    #2 0x753570a75128 in g_strjoin /usr/src/debug/glib2/build/../glib/glib/gstrfuncs.c:2697:16
    #3 0x5aa572db477b in thunar_window_toolbar_get_icon_name thunar/thunar-window.c:6293:12
    #4 0x5aa572db334e in thunar_window_view_switcher_update thunar/thunar-window.c:6511:38
    #5 0x5aa572da8caa in thunar_window_location_toolbar_create thunar/thunar-window.c:6600:3
    #6 0x5aa572d992bb in thunar_window_init thunar/thunar-window.c:1044:3
    #7 0x7535715f2848 in g_type_create_instance /usr/src/debug/glib2/build/../glib/gobject/gtype.c:1951:5
    #8 0x7535715d7684 in g_object_new_internal /usr/src/debug/glib2/build/../glib/gobject/gobject.c:2606:24
    #9 0x7535715d997a in g_object_new_internal /usr/src/debug/glib2/build/../glib/gobject/gobject.c:2923:29
    #10 0x7535715d997a in g_object_new_valist /usr/src/debug/glib2/build/../glib/gobject/gobject.c:2945:16
    #11 0x7535715d9d2f in g_object_new /usr/src/debug/glib2/build/../glib/gobject/gobject.c:2418:12
    #12 0x5aa572b8d743 in thunar_application_open_window thunar/thunar-application.c:1473:12
    #13 0x5aa572b9c155 in thunar_application_process_files_finish thunar/thunar-application.c:1688:11
    #14 0x5aa572b9d027 in thunar_browser_poke_file thunar/thunar-browser.c:537:3
    #15 0x5aa572b8efd0 in thunar_application_process_filenames thunar/thunar-application.c:1864:7
    #16 0x5aa572b98f1c in thunar_application_command_line thunar/thunar-application.c:545:8
    #17 0x753570bb9373 in _g_cclosure_marshal_INT__OBJECTv /usr/src/debug/glib2/build/../glib/gio/gmarshal-internal.c:847:14
    #18 0x7535715e6b61 in _g_closure_invoke_va /usr/src/debug/glib2/build/../glib/gobject/gclosure.c:897:7
    #19 0x7535715e6b61 in signal_emit_valist_unlocked /usr/src/debug/glib2/build/../glib/gobject/gsignal.c:3424:8
    #20 0x7535715e6c71 in g_signal_emit_valist /usr/src/debug/glib2/build/../glib/gobject/gsignal.c:3263:7
    #21 0x7535715e6d33 in g_signal_emit /usr/src/debug/glib2/build/../glib/gobject/gsignal.c:3583:3
    #22 0x753570c22e9f in g_application_call_command_line /usr/src/debug/glib2/build/../glib/gio/gapplication.c:1103:7
    #23 0x753570c22e9f in g_application_call_command_line /usr/src/debug/glib2/build/../glib/gio/gapplication.c:1080:1
    #24 0x753570c26f29 in g_application_real_local_command_line /usr/src/debug/glib2/build/../glib/gio/gapplication.c:1179:7
    #25 0x753570c270a6 in g_application_run /usr/src/debug/glib2/build/../glib/gio/gapplication.c:2681:8
    #26 0x5aa572b67377 in main thunar/main.c:86:3
    #27 0x7535707eee07 in __libc_start_call_main /usr/src/debug/glibc/glibc/csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #28 0x7535707eeecb in __libc_start_main /usr/src/debug/glibc/glibc/csu/../csu/libc-start.c:360:3
    #29 0x5aa572a0b104 in _start (/usr/local/bin/thunar+0x36b104) (BuildId: 06b9a2d62ac0c5ef)

Testing

  • I verified the switcher still changes views
  • I didn't see any new memory errors or leaks with ASan + LSan

Merge request reports