From: Lennart Poettering Date: Fri, 4 Sep 2020 21:54:11 +0000 (+0200) Subject: varlink: properly allocate connection event source X-Git-Tag: v247-rc1~294^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16957%2Fhead;p=thirdparty%2Fsystemd.git 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.) --- diff --git a/src/shared/varlink.c b/src/shared/varlink.c index a84c51f2afb..aeec4247541 100644 --- a/src/shared/varlink.c +++ b/src/shared/varlink.c @@ -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;