From: Lennart Poettering Date: Mon, 12 Nov 2018 11:50:06 +0000 (+0100) Subject: locale-setup: use _cleanup_strv_free_ X-Git-Tag: v240~320^2~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=05e062cb89052705442ee43c48979d926fb3fda9;p=thirdparty%2Fsystemd.git locale-setup: use _cleanup_strv_free_ --- diff --git a/src/core/locale-setup.c b/src/core/locale-setup.c index c14523fee9f..c123f3906e4 100644 --- a/src/core/locale-setup.c +++ b/src/core/locale-setup.c @@ -14,8 +14,8 @@ #include "virt.h" int locale_setup(char ***environment) { - char **add; char *variables[_VARIABLE_LC_MAX] = {}; + _cleanup_strv_free_ char **add = NULL; int r = 0, i; if (detect_container() <= 0) { @@ -64,7 +64,6 @@ int locale_setup(char ***environment) { log_warning_errno(r, "Failed to read /etc/locale.conf: %m"); } - add = NULL; for (i = 0; i < _VARIABLE_LC_MAX; i++) { char *s; @@ -98,8 +97,6 @@ int locale_setup(char ***environment) { r = 0; finish: - strv_free(add); - for (i = 0; i < _VARIABLE_LC_MAX; i++) free(variables[i]);