Skip to content

Fix leak of search_query string

correctmost requested to merge correctmost/thunar:cm/fix-query-leak into master

Description

I triggered this leak after closing a window with multiple search tabs open.

Leak report

Direct leak of 5 byte(s) in 1 object(s) allocated from:
    #0 0x5f07285d97b9 in malloc (/usr/local/bin/thunar+0x4987b9) (BuildId: 4393f5858fee53d0)
    #1 0x76dcaacdce4a in g_malloc /usr/src/debug/glib2/build/../glib/glib/gmem.c:100:13
    #2 0x76dcaacf325a in g_strdup /usr/src/debug/glib2/build/../glib/glib/gstrfuncs.c:323:17
    #3 0x5f0728923b5c in g_strdup_inline /usr/include/glib-2.0/glib/gstrfuncs.h:321:10
    #4 0x5f0728923b5c in thunar_standard_view_set_searching thunar/thunar-standard-view.c:4498:39
    #5 0x5f0728a0f9c5 in thunar_window_update_search thunar/thunar-window.c:3490:3
    #6 0x5f07288408d9 in thunar_path_entry_changed thunar/thunar-path-entry.c:604:7
    #7 0x76dcaac2c699 in g_closure_invoke /usr/src/debug/glib2/build/../glib/gobject/gclosure.c:834:7
    #8 0x76dcaac5d8a1 in signal_emit_unlocked_R.isra.0 /usr/src/debug/glib2/build/../glib/gobject/gsignal.c:3928:7
    #9 0x76dcaac4da0b in signal_emit_valist_unlocked /usr/src/debug/glib2/build/../glib/gobject/gsignal.c:3520:7
    #10 0x76dcaac4df51 in g_signal_emit_by_name /usr/src/debug/glib2/build/../glib/gobject/gsignal.c:3624:11
    #11 0x76dcab1db7be in end_change gtkentry.c
    #12 0x76dcab1e18bd in gtk_entry_real_delete_text gtkentry.c
    #13 0x76dcab09d624 in _gtk_marshal_VOID__INT_INT (/usr/local/lib/libgtk-3.so.0+0x9d624) (BuildId: 830e6aaba956cec9e1a102747acf8811ebecd088)
    #14 0x76dcaac2c699 in g_closure_invoke /usr/src/debug/glib2/build/../glib/gobject/gclosure.c:834:7
    #15 0x76dcaac5d8a1 in signal_emit_unlocked_R.isra.0 /usr/src/debug/glib2/build/../glib/gobject/gsignal.c:3928:7
    #16 0x76dcaac4da0b in signal_emit_valist_unlocked /usr/src/debug/glib2/build/../glib/gobject/gsignal.c:3520:7
    #17 0x76dcaac4df51 in g_signal_emit_by_name /usr/src/debug/glib2/build/../glib/gobject/gsignal.c:3624:11
    #18 0x76dcab1e1130 in gtk_entry_delete_text gtkentry.c
    #19 0x76dcab1d11af in gtk_editable_delete_text (/usr/local/lib/libgtk-3.so.0+0x1d11af) (BuildId: 830e6aaba956cec9e1a102747acf8811ebecd088)
    #20 0x76dcab1e2b64 in gtk_entry_backspace gtkentry.c
    #21 0x76dcaac2c699 in g_closure_invoke /usr/src/debug/glib2/build/../glib/gobject/gclosure.c:834:7
    #22 0x76dcaac5d8a1 in signal_emit_unlocked_R.isra.0 /usr/src/debug/glib2/build/../glib/gobject/gsignal.c:3928:7
    #23 0x76dcaac4a8eb in signal_emitv_unlocked /usr/src/debug/glib2/build/../glib/gobject/gsignal.c:3212:3
    #24 0x76dcaac4a8eb in g_signal_emitv /usr/src/debug/glib2/build/../glib/gobject/gsignal.c:3112:3
    #25 0x76dcab0e7770 in gtk_binding_entry_activate gtkbindings.c
    #26 0x76dcab0e9034 in binding_activate gtkbindings.c
    #27 0x76dcab0e91d2 in gtk_bindings_activate_list gtkbindings.c
    #28 0x76dcab0e946f in gtk_bindings_activate_event (/usr/local/lib/libgtk-3.so.0+0xe946f) (BuildId: 830e6aaba956cec9e1a102747acf8811ebecd088)
    #29 0x76dcab4bc5b7 in gtk_widget_real_key_press_event gtkwidget.c

Merge request reports