local: fix memory leak when putting together locale settings

Also, we need to use proper strv_env_xyz() calls when putting together
the environment array, since otherwise settings won't be properly
overriden.

And let's get rid of strv_appendf(), is overkill and there was only one
user.
This commit is contained in:
Lennart Poettering
2013-10-01 00:17:21 +02:00
parent 6c081276dc
commit bcd8e6d1bd
4 changed files with 30 additions and 21 deletions
-15
View File
@@ -424,21 +424,6 @@ fail:
return NULL;
}
char **strv_appendf(char **l, const char *format, ...) {
va_list ap;
_cleanup_free_ char *s = NULL;
int r;
va_start(ap, format);
r = vasprintf(&s, format, ap);
va_end(ap);
if (r < 0)
return NULL;
return strv_append(l, s);
}
int strv_push(char ***l, char *value) {
char **c;
unsigned n;
-1
View File
@@ -42,7 +42,6 @@ unsigned strv_length(char * const *l) _pure_;
char **strv_merge(char **a, char **b);
char **strv_merge_concat(char **a, char **b, const char *suffix);
char **strv_append(char **l, const char *s);
char **strv_appendf(char **l, const char *format, ...) _printf_attr_(2, 3);
int strv_extend(char ***l, const char *value);
int strv_push(char ***l, char *value);