lsblk: fix heap-use-after-free

Addresses: https://github.com/karelzak/util-linux/issues/787
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2019-05-06 12:39:07 +02:00
parent 281a2f3212
commit f6f8a671a9
1 changed files with 1 additions and 0 deletions

View File

@ -1560,6 +1560,7 @@ static int process_all_devices(struct lsblk_devtree *tr)
if (is_maj_excluded(dev->maj) || !is_maj_included(dev->maj)) {
DBG(DEV, ul_debug(" %s: ignore (by filter)", d->d_name));
lsblk_devtree_remove_device(tr, dev);
dev = NULL;
goto next;
}