chiark / gitweb /
mount: when learning about the root mount from mountinfo, don't add conflicting dep...
[elogind.git] / src / activate / activate.c
index a6e72485749783c1a95ec9ec5692b92dad1a63bf..87526d47cc8e5babdbb37873f6f83846f0fe4052 100644 (file)
@@ -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,9 +171,10 @@ 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;
+        _cleanup_strv_free_ char **envp = NULL;
+        char **s;
         static const char* tocopy[] = {"TERM=", "PATH=", "USER=", "HOME="};
-        char _cleanup_free_ *tmp = NULL;
+        _cleanup_free_ char *tmp = NULL;
         unsigned i;
 
         length = strv_length(arg_environ);
@@ -179,7 +185,7 @@ static int launch(char* name, char **argv, char **env, int fds) {
                 if (strchr(*s, '='))
                         envp[n_env++] = *s;
                 else {
-                        char _cleanup_free_ *p = strappend(*s, "=");
+                        _cleanup_free_ char *p = strappend(*s, "=");
                         if (!p)
                                 return log_oom();
                         envp[n_env] = strv_find_prefix(env, p);
@@ -212,7 +218,7 @@ static int launch1(const char* child, char** argv, char **env, int fd) {
         pid_t parent_pid, child_pid;
         int r;
 
-        char _cleanup_free_ *tmp = NULL;
+        _cleanup_free_ char *tmp = NULL;
         tmp = strv_join(argv, " ");
         if (!tmp)
                 return log_oom();