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:
parent
281a2f3212
commit
f6f8a671a9
|
@ -1560,6 +1560,7 @@ static int process_all_devices(struct lsblk_devtree *tr)
|
||||||
if (is_maj_excluded(dev->maj) || !is_maj_included(dev->maj)) {
|
if (is_maj_excluded(dev->maj) || !is_maj_included(dev->maj)) {
|
||||||
DBG(DEV, ul_debug(" %s: ignore (by filter)", d->d_name));
|
DBG(DEV, ul_debug(" %s: ignore (by filter)", d->d_name));
|
||||||
lsblk_devtree_remove_device(tr, dev);
|
lsblk_devtree_remove_device(tr, dev);
|
||||||
|
dev = NULL;
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue