diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-03-12 04:20:13 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-03-12 09:15:02 +0100 |
commit | 1f682e243fa0863c9f4f89adf89032ae37e8205e (patch) | |
tree | 003179f263462d0a507ea000b568496688c76a98 /src/udev/udevadm-trigger.c | |
parent | efivars: make sure efi_loader_entry_name_valid() is always compiled in (diff) | |
download | systemd-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.c | 4 |
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)) |