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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user