Remove extra checks before call of g_strfreev().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2011-01-26 13:40:20 +03:00 committed by Slava Zanko
parent 1ceb2494e4
commit ac8e519854
2 changed files with 4 additions and 14 deletions

View File

@ -130,9 +130,7 @@ mc_skin_color_get_from_ini_file (mc_skin_t * mc_skin, const gchar * group, const
mc_skin_color_t *mc_skin_color, *tmp;
values = mc_config_get_string_list (mc_skin->config, group, key, &items_count);
if (values == NULL)
return NULL;
if (*values == NULL)
if (values == NULL || values[0] == NULL)
{
g_strfreev (values);
return NULL;
@ -307,11 +305,7 @@ mc_skin_color_parse_ini_file (mc_skin_t * mc_skin)
mc_skin_color_check_bw_mode (mc_skin);
orig_groups = groups = mc_config_get_groups (mc_skin->config, &items_count);
if (groups == NULL)
return FALSE;
if (*groups == NULL)
if (groups == NULL || groups[0] == NULL)
{
g_strfreev (groups);
return FALSE;

View File

@ -605,9 +605,7 @@ load_keys_from_section (const char *terminal, mc_config_t * cfg)
}
profile_keys++;
if (values != NULL)
g_strfreev (values);
g_strfreev (values);
}
g_strfreev (keys);
g_free (section_name);
@ -659,9 +657,7 @@ load_keymap_from_section (const char *section_name, GArray * keymap, mc_config_t
}
profile_keys++;
if (values != NULL)
g_strfreev (values);
g_strfreev (values);
}
g_strfreev (keys);
}