diff options
author | Sebastian Keller <skeller@gnome.org> | 2023-04-16 23:23:11 +0200 |
---|---|---|
committer | Sebastian Keller <skeller@gnome.org> | 2023-04-17 10:38:33 +0200 |
commit | 15048c1fcbf63e5e7f6f1651130208a0313fc93c (patch) | |
tree | 20fa61da412e998693c07e84b83c018fdfc14c3e | |
parent | a8ae5fa1ec4f6a5316a017faf6f90e34c5f60fe6 (diff) | |
download | gnome-shell-15048c1fcbf63e5e7f6f1651130208a0313fc93c.tar.gz |
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>
-rw-r--r-- | src/st/st-icon-theme.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/st/st-icon-theme.c b/src/st/st-icon-theme.c index 9edde5c77..9128c57ef 100644 --- a/src/st/st-icon-theme.c +++ b/src/st/st-icon-theme.c @@ -1413,7 +1413,6 @@ real_choose_icon (StIconTheme *icon_theme, else { static gboolean check_for_default_theme = TRUE; - g_autofree char *default_theme_path = NULL; gboolean found = FALSE; 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++) { + g_autofree char *default_theme_path = NULL; + default_theme_path = g_build_filename (icon_theme->search_path[i], FALLBACK_ICON_THEME, "index.theme", |