The qdev_get_printable_name() function is currently unusable without leaking memory, because sometimes it returns a string that must be freed and sometimes a string that must not be freed.
Fix this by making it always return a string that the caller must free. Patch 1 addresses an underlying cause of this -- we didn't document qdev_get_dev_path() and in particular didn't document that its return value is a string the caller must free. thanks -- PMM Peter Maydell (2): hw/qdev: Document qdev_get_dev_path() hw: Make qdev_get_printable_name() consistently return freeable string hw/core/qdev.c | 4 ++-- hw/virtio/virtio.c | 12 +++++++++--- include/hw/core/qdev.h | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 5 deletions(-) -- 2.43.0
