mirror of
https://github.com/systemd/systemd.git
synced 2025-08-25 13:49:55 +03:00
home: fix heap-use-after-free
`bus_home_emit_remove()` may be called from manager_free() -> home_free(). In that case, manager->bus is already unref()ed. Fixes #21767.
This commit is contained in:
@ -940,6 +940,12 @@ int bus_home_emit_remove(Home *h) {
|
||||
if (!h->announced)
|
||||
return 0;
|
||||
|
||||
if (!h->manager)
|
||||
return 0;
|
||||
|
||||
if (!h->manager->bus)
|
||||
return 0;
|
||||
|
||||
r = bus_home_path(h, &path);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
Reference in New Issue
Block a user