locale-setup: use _cleanup_strv_free_

This commit is contained in:
Lennart Poettering
2018-11-14 17:01:54 +01:00
parent 78b30ee056
commit 05e062cb89
+1 -4
View File
@@ -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]);