From a2b08f934267500d05bee87bb4388944cda0a700 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 18 Jun 2018 10:36:33 -0400 Subject: [PATCH] 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 --- src/libostree/ostree-repo.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index fa5a9bf8..8e7e4ca0 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -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;