summaryrefslogtreecommitdiffstats
path: root/src/udev/udevadm-trigger.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-03-12 04:20:13 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-03-12 09:15:02 +0100
commit1f682e243fa0863c9f4f89adf89032ae37e8205e (patch)
tree003179f263462d0a507ea000b568496688c76a98 /src/udev/udevadm-trigger.c
parentefivars: make sure efi_loader_entry_name_valid() is always compiled in (diff)
downloadsystemd-1f682e243fa0863c9f4f89adf89032ae37e8205e.tar.xz
systemd-1f682e243fa0863c9f4f89adf89032ae37e8205e.zip
udev: fix memleak in 'udevadm trigger --settle'
Fixes #11966.
Diffstat (limited to 'src/udev/udevadm-trigger.c')
-rw-r--r--src/udev/udevadm-trigger.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c
index b5e5f091ca..b7dafb7755 100644
--- a/src/udev/udevadm-trigger.c
+++ b/src/udev/udevadm-trigger.c
@@ -60,6 +60,7 @@ static int exec_list(sd_device_enumerator *e, const char *action, Set *settle_se
}
static int device_monitor_handler(sd_device_monitor *m, sd_device *dev, void *userdata) {
+ _cleanup_free_ char *val = NULL;
Set *settle_set = userdata;
const char *syspath;
@@ -72,7 +73,8 @@ static int device_monitor_handler(sd_device_monitor *m, sd_device *dev, void *us
if (arg_verbose)
printf("settle %s\n", syspath);
- if (!set_remove(settle_set, syspath))
+ val = set_remove(settle_set, syspath);
+ if (!val)
log_debug("Got epoll event on syspath %s not present in syspath set", syspath);
if (set_isempty(settle_set))