Skip to content

Commit

Permalink
bus_open leak sd_event_source when udevadm trigger。
Browse files Browse the repository at this point in the history
On my host, when executing the udevadm trigger, I only receive the change event, which causes memleak
  • Loading branch information
hexiaowen authored and keszybz committed May 22, 2019
1 parent 1f7b687 commit b2774a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/login/logind-button.c
Expand Up @@ -341,7 +341,8 @@ int button_open(Button *b) {
}

(void) button_set_mask(b);


b->io_event_source = sd_event_source_unref(b->io_event_source);
r = sd_event_add_io(b->manager->event, &b->io_event_source, b->fd, EPOLLIN, button_dispatch, b);
if (r < 0) {
log_error_errno(r, "Failed to add button event: %m");
Expand Down

0 comments on commit b2774a3

Please sign in to comment.