From fff40a51ccbb02e8dec4ff2ee505bc84f75e445c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 31 Mar 2013 18:18:10 -0400 Subject: [PATCH 1/1] activate: do not leak envp on error --- src/activate/activate.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/activate/activate.c b/src/activate/activate.c index a6e724857..3ea2470a1 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; -- 2.30.2