Skip to content

Commit b2774a3

Browse files
hexiaowenkeszybz
authored andcommitted
bus_open leak sd_event_source when udevadm trigger。
On my host, when executing the udevadm trigger, I only receive the change event, which causes memleak
1 parent 1f7b687 commit b2774a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/login/logind-button.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ int button_open(Button *b) {
341341
}
342342

343343
(void) button_set_mask(b);
344-
344+
345+
b->io_event_source = sd_event_source_unref(b->io_event_source);
345346
r = sd_event_add_io(b->manager->event, &b->io_event_source, b->fd, EPOLLIN, button_dispatch, b);
346347
if (r < 0) {
347348
log_error_errno(r, "Failed to add button event: %m");

0 commit comments

Comments
 (0)