updateiconcache: Fix path leak in scan_directory
Leak report
Direct leak of 2688 byte(s) in 21 object(s) allocated from:
#0 0x79de5b0fc542 in realloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:85
#1 0x79de5a8b95ad in g_realloc glib/gmem.c:171
#2 0x79de5a92b834 in g_string_expand glib/gstring.c:82
#3 0x79de5a92ba03 in g_string_sized_new glib/gstring.c:113
#4 0x79de5a92d600 in g_string_new glib/gstring.c:134
#5 0x79de5a8385ac in g_build_path_va glib/gfileutils.c:1914
#6 0x79de5a83bb9c in g_build_path glib/gfileutils.c:2077
#7 0x56953a8002e5 in scan_directory gtk/updateiconcache.c:609
#8 0x56953a800438 in scan_directory gtk/updateiconcache.c:644
#9 0x56953a800438 in scan_directory gtk/updateiconcache.c:644
#10 0x56953a803211 in build_cache gtk/updateiconcache.c:1527
#11 0x56953a805391 in main gtk/updateiconcache.c:1769
Testing
- No issues were detected when testing the patch with ASan + LSan
Related MR: !7869