]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/s390x/ccw-device: Fix memory leak in loadparm setter
authorKevin Wolf <kwolf@redhat.com>
Wed, 25 Jun 2025 08:27:51 +0000 (10:27 +0200)
committerThomas Huth <thuth@redhat.com>
Wed, 25 Jun 2025 22:42:28 +0000 (00:42 +0200)
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 <kwolf@redhat.com>
Message-ID: <20250625082751.24896-1-kwolf@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
hw/s390x/ccw-device.c

index 19c2238f7603c93b65d9409d61dc1e0f36e0307d..8be1813b9e7ec0f372a09acca5143aa08bdf610d 100644 (file)
@@ -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);