summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-10-01 00:08:30 +0200
committerLennart Poettering <lennart@poettering.net>2013-10-01 00:17:21 +0200
commitbcd8e6d1bd3f434af894faeb400fee0e99445a7f (patch)
tree1c0668d6b4e3bab3b2af0438525a62d318e2b37f /src/core/manager.c
parent6c081276dc11722656906361ac78e415757865e3 (diff)
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.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index bc57e4a1fd..58dacdc8b5 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -2665,14 +2665,16 @@ void manager_undo_generators(Manager *m) {
}
int manager_environment_add(Manager *m, char **environment) {
-
char **e = NULL;
assert(m);
+
e = strv_env_merge(2, m->environment, environment);
if (!e)
return -ENOMEM;
+
strv_free(m->environment);
m->environment = e;
+
return 0;
}