(load_group): fix use after free.

Found by Coverity.
Coverity id #331812.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andreas Mohr 2021-05-30 14:17:27 +00:00 committed by Andrew Borodin
parent c15b752fbf
commit 10c27b28a7

View File

@ -1210,7 +1210,6 @@ load_group (struct hotlist *grp)
add2hotlist (mc_config_get_string (mc_global.main_config, group_section, *profile_keys, ""),
g_strdup (*profile_keys), HL_TYPE_GROUP, LISTBOX_APPEND_AT_END);
g_free (group_section);
g_strfreev (keys);
keys = mc_config_get_keys (mc_global.main_config, grp->directory, NULL);
@ -1219,6 +1218,7 @@ load_group (struct hotlist *grp)
add2hotlist (mc_config_get_string (mc_global.main_config, group_section, *profile_keys, ""),
g_strdup (*profile_keys), HL_TYPE_ENTRY, LISTBOX_APPEND_AT_END);
g_free (group_section);
g_strfreev (keys);
for (current = grp->head; current; current = current->next)