summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-31 18:18:10 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-31 19:01:57 -0400
commitfff40a51ccbb02e8dec4ff2ee505bc84f75e445c (patch)
tree8343c5f0056a63c6d674c5e7349971ffac709f8d /src
parentfb93cf737549f2d5fce6cb76b1d5e8382c7537b8 (diff)
activate: do not leak envp on error
Diffstat (limited to 'src')
-rw-r--r--src/activate/activate.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/activate/activate.c b/src/activate/activate.c
index a6e7248574..3ea2470a1f 100644
--- a/src/activate/activate.c
+++ b/src/activate/activate.c
@@ -137,6 +137,11 @@ static int open_sockets(int *epoll_fd, bool accept) {
count ++;
}
+ /** Note: we leak some fd's on error here. I doesn't matter
+ * much, since the program will exit immediately anyway, but
+ * would be a pain to fix.
+ */
+
STRV_FOREACH(address, arg_listen) {
log_info("Opening address %s", *address);
@@ -166,7 +171,8 @@ static int open_sockets(int *epoll_fd, bool accept) {
static int launch(char* name, char **argv, char **env, int fds) {
unsigned n_env = 0, length;
- char **envp = NULL, **s;
+ char _cleanup_strv_free_ **envp = NULL;
+ char **s;
static const char* tocopy[] = {"TERM=", "PATH=", "USER=", "HOME="};
char _cleanup_free_ *tmp = NULL;
unsigned i;