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:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user