chiark / gitweb /
activate: do not leak envp on error
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 31 Mar 2013 22:18:10 +0000 (18:18 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 31 Mar 2013 23:01:57 +0000 (19:01 -0400)
src/activate/activate.c

index a6e72485749783c1a95ec9ec5692b92dad1a63bf..3ea2470a1faa93361576095ad3388a1cabd21d21 100644 (file)
@@ -137,6 +137,11 @@ static int open_sockets(int *epoll_fd, bool accept) {
                 count ++;
         }
 
                 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);
 
         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;
 
 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;
         static const char* tocopy[] = {"TERM=", "PATH=", "USER=", "HOME="};
         char _cleanup_free_ *tmp = NULL;
         unsigned i;