]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
service: use newdup() where appropriate
authorLennart Poettering <lennart@poettering.net>
Tue, 4 Apr 2023 14:25:33 +0000 (16:25 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 5 Apr 2023 06:25:36 +0000 (15:25 +0900)
src/core/service.c

index da75540c3178457eebae9159fc538f82cfc982ff..48229f96ee3da629f4c57a0eb8399b0cec3d6927 100644 (file)
@@ -1407,10 +1407,9 @@ static int service_collect_fds(
 
                 /* Pass the per-connection socket */
 
-                rfds = new(int, 1);
+                rfds = newdup(int, &s->socket_fd, 1);
                 if (!rfds)
                         return -ENOMEM;
-                rfds[0] = s->socket_fd;
 
                 rfd_names = strv_new("connection");
                 if (!rfd_names)