mime: Fix xfce_mime_helper_category_to_string leak
Leak report
Direct leak of 11 byte(s) in 1 object(s) allocated from:
#0 0x7ce84aefd891 in malloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:69
#1 0x7ce8474b8b87 in g_malloc glib/gmem.c:100
#2 0x7ce847520ecf in g_strdup glib/gstrfuncs.c:323
#3 0x5b7bba3bf821 in g_strdup_inline /usr/local/include/glib-2.0/glib/gstrfuncs.h:321
#4 0x5b7bba3bf821 in xfce_mime_helper_category_to_string xfce4-settings/dialogs/mime-settings/xfce-mime-helper-utils.c:85
#5 0x5b7bba3c3bb7 in xfce_mime_helper_database_clear_default xfce4-settings/dialogs/mime-settings/xfce-mime-helper.c:959
#6 0x5b7bba3c5e66 in main xfce4-settings/dialogs/mime-settings/xfce-mime-helper-main.c:196
Steps to reproduce
- Run
xfce4-mime-helper --launch mailreader
on a system without a mail reader association - Press Cancel on the "Choose Preferred Application" dialog
Testing
- No issues were detected when testing the patch with ASan + LSan