lib/repo: Fix double-set-error in min-free-space-size code

We need to pass `NULL` as the error, we only care if the key exists;
otherwise we'll try to set the error twice.

Closes: #1632
Approved by: jlebon
This commit is contained in:
Colin Walters 2018-06-18 10:36:33 -04:00 committed by Atomic Bot
parent cc5254ac34
commit a2b08f9342
1 changed files with 5 additions and 5 deletions

View File

@ -2670,7 +2670,7 @@ min_free_space_size_validate_and_convert (OstreeRepo *self,
g_autoptr(GMatchInfo) match = NULL;
if (!g_regex_match (regex, min_free_space_size_str, 0, &match))
return glnx_prefix_error (error, "Error parsing min-free-space-size parameter: '%s'", min_free_space_size_str);
return glnx_prefix_error (error, "Failed to parse min-free-space-size parameter: '%s'", min_free_space_size_str);
g_autofree char *size_str = g_match_info_fetch (match, 1);
g_autofree char *unit = g_match_info_fetch (match, 2);
@ -2814,12 +2814,12 @@ reload_core_config (OstreeRepo *self,
}
{
if (g_key_file_has_key (self->config, "core", "min-free-space-size", error) &&
g_key_file_has_key (self->config, "core", "min-free-space-percent", error))
if (g_key_file_has_key (self->config, "core", "min-free-space-size", NULL) &&
g_key_file_has_key (self->config, "core", "min-free-space-percent", NULL))
{
return glnx_throw (error, "min-free-space-percent and min-free-space-size are mutually exclusive.");
return glnx_throw (error, "min-free-space-percent and min-free-space-size are mutually exclusive");
}
else if (g_key_file_has_key (self->config, "core", "min-free-space-size", error))
else if (g_key_file_has_key (self->config, "core", "min-free-space-size", NULL))
{
g_autofree char *min_free_space_size_str = NULL;