diff options
Diffstat (limited to 'src/locale/localectl.c')
-rw-r--r-- | src/locale/localectl.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/locale/localectl.c b/src/locale/localectl.c index c8278a383d..75e7a55676 100644 --- a/src/locale/localectl.c +++ b/src/locale/localectl.c @@ -49,10 +49,10 @@ static void status_info_clear(StatusInfo *info) { } static void print_overridden_variables(void) { - int r; - char *variables[_VARIABLE_LC_MAX] = {}; - LocaleVariable j; + _cleanup_(locale_variables_freep) char *variables[_VARIABLE_LC_MAX] = {}; bool print_warning = true; + LocaleVariable j; + int r; if (arg_transport != BUS_TRANSPORT_LOCAL) return; @@ -75,7 +75,7 @@ static void print_overridden_variables(void) { "locale.LC_IDENTIFICATION", &variables[VARIABLE_LC_IDENTIFICATION]); if (r < 0 && r != -ENOENT) { log_warning_errno(r, "Failed to read /proc/cmdline: %m"); - goto finish; + return; } for (j = 0; j < _VARIABLE_LC_MAX; j++) @@ -88,9 +88,6 @@ static void print_overridden_variables(void) { } else log_warning(" %s=%s", locale_variable_to_string(j), variables[j]); } - finish: - for (j = 0; j < _VARIABLE_LC_MAX; j++) - free(variables[j]); } static void print_status_info(StatusInfo *i) { |