]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
varlink: properly allocate connection event source 16957/head
authorLennart Poettering <lennart@poettering.net>
Fri, 4 Sep 2020 21:54:11 +0000 (23:54 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 4 Sep 2020 21:54:14 +0000 (23:54 +0200)
Let's make sure we keep a reference to the event source

(Note that this code is currently not used, which is why this was never
used: in all cases we do not add listener fds after the event is
attached, but before. In that case this code is not called.)

src/shared/varlink.c

index a84c51f2afbbd2501058ecb3f9a4f93e8ced179e..aeec424754179d09d105288430d638caf273a011 100644 (file)
@@ -2212,9 +2212,7 @@ int varlink_server_listen_fd(VarlinkServer *s, int fd) {
         };
 
         if (s->event) {
-                _cleanup_(sd_event_source_unrefp) sd_event_source *es = NULL;
-
-                r = sd_event_add_io(s->event, &es, fd, EPOLLIN, connect_callback, ss);
+                r = sd_event_add_io(s->event, &ss->event_source, fd, EPOLLIN, connect_callback, ss);
                 if (r < 0)
                         return r;