From: Kevin Wolf Date: Wed, 25 Jun 2025 08:27:51 +0000 (+0200) Subject: hw/s390x/ccw-device: Fix memory leak in loadparm setter X-Git-Tag: v10.1.0-rc0~41^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78e3781541209b3dcd6f4bb66adf3a3e504b88a4;p=thirdparty%2Fqemu.git hw/s390x/ccw-device: Fix memory leak in loadparm setter Commit bdf12f2a fixed the setter for the "loadparm" machine property, which gets a string from a visitor, passes it to s390_ipl_fmt_loadparm() and then forgot to free it. It left another instance of the same problem unfixed in the "loadparm" device property. Fix it. Signed-off-by: Kevin Wolf Message-ID: <20250625082751.24896-1-kwolf@redhat.com> Reviewed-by: Eric Farman Reviewed-by: Halil Pasic Tested-by: Thomas Huth Signed-off-by: Thomas Huth --- diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c index 19c2238f760..8be1813b9e7 100644 --- a/hw/s390x/ccw-device.c +++ b/hw/s390x/ccw-device.c @@ -57,7 +57,7 @@ static void ccw_device_set_loadparm(Object *obj, Visitor *v, Error **errp) { CcwDevice *dev = CCW_DEVICE(obj); - char *val; + g_autofree char *val = NULL; int index; index = object_property_get_int(obj, "bootindex", NULL);