According to include/qom/object.h: /** * object_property_get_str: * @obj: the object * @name: the name of the property * @errp: returns an error if this function fails * * Returns: the value of the property, converted to a C string, or NULL if * an error occurs (including when the property value is not a string). * The caller should free the string. */
So I've checked all the call sites and found three places where the string is obviously [*] leaked. Patch 2 and 3 fix very recent 2.12 commits, while patch 1 fixes a 2.4 commit (backported to 2.3.1). Another potential candidate sits in query_memdev(), called during the "info memdev" HMP and the "query-memdev" QMP commands, but both take care of freeing the string eventually. Nothing to fix there. [*] allocated string is put in a local variable and not freed before returning -- Greg --- Greg Kurz (3): exec: fix memory leak in find_max_supported_pagesize() hw/s390x: fix memory leak in s390_init_ipl_dev() sev/i386: fix memory leak in sev_guest_init() exec.c | 1 + hw/s390x/s390-virtio-ccw.c | 5 ++++- target/i386/sev.c | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-)