varlink: properly allocate connection event source

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.)
This commit is contained in:
Lennart Poettering
2020-09-04 23:54:14 +02:00
parent 1ba37106b3
commit 8d91b2206c
+1 -3
View 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;