Skip to content

Fix color string leaks in properties dialog

Leak report

Direct leak of 17 byte(s) in 1 object(s) allocated from:
    #0 0x5a22d1b88bf9 in malloc (/usr/asan/bin/thunar+0x457bf9)
    #1 0x7dd155c97438 in __vasprintf_internal /usr/src/debug/glibc/glibc/libio/vasprintf.c:116:16
    #2 0x5a22d1b5969b in vasprintf (/usr/asan/bin/thunar+0x42869b)
    #3 0x7dd156082457 in g_vasprintf glib/gprintf.c:341:11
    #4 0x7dd156011d38 in g_strdup_vprintf glib/gstrfuncs.c:511:3
    #5 0x7dd156011d38 in g_strdup_printf glib/gstrfuncs.c:541:12
    #6 0x7dd157b28cd2 in gdk_rgba_to_string gdk/gdkrgba.c:360:14
    #7 0x5a22d1d3f46f in thunar_properties_dialog_set_foreground thunar/thunar-properties-dialog.c:2077:15
[...snip...]

Direct leak of 17 byte(s) in 1 object(s) allocated from:
    #0 0x589c3461ebf9 in malloc (/usr/asan/bin/thunar+0x457bf9)
    #1 0x78c85c697438 in __vasprintf_internal /usr/src/debug/glibc/glibc/libio/vasprintf.c:116:16
    #2 0x589c345ef69b in vasprintf (/usr/asan/bin/thunar+0x42869b)
    #3 0x78c85ca82457 in g_vasprintf glib/gprintf.c:341:11
    #4 0x78c85ca11d38 in g_strdup_vprintf glib/gstrfuncs.c:511:3
    #5 0x78c85ca11d38 in g_strdup_printf glib/gstrfuncs.c:541:12
    #6 0x78c85e728cd2 in gdk_rgba_to_string gdk/gdkrgba.c:360:14
    #7 0x589c347d58ef in thunar_properties_dialog_set_background thunar/thunar-properties-dialog.c:2096:15
[...snip...]

Steps to reproduce

  • Set a background or foreground color in the properties dialog

Testing

  • No issues were detected with LSan, ASan, or Valgrind when testing the patch

Merge request reports