ryantimwilson / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
4cad4c
From 448b34284c09469eaa2168291ccb34afc3e4cc1d Mon Sep 17 00:00:00 2001
4cad4c
From: ven <2988994+hexiaowen@users.noreply.github.com>
4cad4c
Date: Wed, 22 May 2019 14:24:28 +0800
4cad4c
Subject: [PATCH] =?UTF-8?q?bus=5Fopen=20leak=20sd=5Fevent=5Fsource=20when?=
4cad4c
 =?UTF-8?q?=20udevadm=20trigger=E3=80=82?=
4cad4c
MIME-Version: 1.0
4cad4c
Content-Type: text/plain; charset=UTF-8
4cad4c
Content-Transfer-Encoding: 8bit
4cad4c
4cad4c
On my host, when executing the udevadm trigger, I only receive the change event, which causes memleak
4cad4c
4cad4c
(cherry picked from commit b2774a3ae692113e1f47a336a6c09bac9cfb49ad)
4cad4c
4cad4c
Resolves: #1798504
4cad4c
---
4cad4c
 src/login/logind-button.c | 1 +
4cad4c
 1 file changed, 1 insertion(+)
4cad4c
4cad4c
diff --git a/src/login/logind-button.c b/src/login/logind-button.c
4cad4c
index 0defa6b9ba..9944eb2316 100644
4cad4c
--- a/src/login/logind-button.c
4cad4c
+++ b/src/login/logind-button.c
4cad4c
@@ -341,6 +341,7 @@ int button_open(Button *b) {
4cad4c
 
4cad4c
         (void) button_set_mask(b);
4cad4c
 
4cad4c
+        b->io_event_source = sd_event_source_unref(b->io_event_source);
4cad4c
         r = sd_event_add_io(b->manager->event, &b->io_event_source, b->fd, EPOLLIN, button_dispatch, b);
4cad4c
         if (r < 0) {
4cad4c
                 log_error_errno(r, "Failed to add button event: %m");