qbus: fix memory leak in qbus_free()
BusState::name is allocated in qbus_create_inplace(). So it should be freed by qbus_free(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
bd418d90d0
commit
e163ae7b8f
|
@ -700,6 +700,7 @@ void qbus_free(BusState *bus)
|
||||||
QLIST_REMOVE(bus, sibling);
|
QLIST_REMOVE(bus, sibling);
|
||||||
bus->parent->num_child_bus--;
|
bus->parent->num_child_bus--;
|
||||||
}
|
}
|
||||||
|
qemu_free((void*)bus->name);
|
||||||
if (bus->qdev_allocated) {
|
if (bus->qdev_allocated) {
|
||||||
qemu_free(bus);
|
qemu_free(bus);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue