st/icon-theme: Fix small memory leak when checking fallback theme path
This is a small one time leak if there is more than one entry in the
search path due to multiple iterations overwriting the old pointer
before finally going out of scope.
Fixes: 934faaace
("st/icon-theme: Start using g_autofree")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2737>
This commit is contained in:
parent
a8ae5fa1ec
commit
15048c1fcb
@ -1413,7 +1413,6 @@ real_choose_icon (StIconTheme *icon_theme,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
static gboolean check_for_default_theme = TRUE;
|
static gboolean check_for_default_theme = TRUE;
|
||||||
g_autofree char *default_theme_path = NULL;
|
|
||||||
gboolean found = FALSE;
|
gboolean found = FALSE;
|
||||||
|
|
||||||
if (check_for_default_theme)
|
if (check_for_default_theme)
|
||||||
@ -1422,6 +1421,8 @@ real_choose_icon (StIconTheme *icon_theme,
|
|||||||
|
|
||||||
for (i = 0; !found && i < icon_theme->search_path_len; i++)
|
for (i = 0; !found && i < icon_theme->search_path_len; i++)
|
||||||
{
|
{
|
||||||
|
g_autofree char *default_theme_path = NULL;
|
||||||
|
|
||||||
default_theme_path = g_build_filename (icon_theme->search_path[i],
|
default_theme_path = g_build_filename (icon_theme->search_path[i],
|
||||||
FALLBACK_ICON_THEME,
|
FALLBACK_ICON_THEME,
|
||||||
"index.theme",
|
"index.theme",
|
||||||
|
Loading…
Reference in New Issue
Block a user