tests/qtest/tpm-util.c: Free memory with correct free function
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 3 May 2021 16:55:23 +0000 (17:55 +0100)
committerThomas Huth <thuth@redhat.com>
Fri, 14 May 2021 10:28:01 +0000 (12:28 +0200)
tpm_util_migration_start_qemu() allocates memory with g_strdup_printf()
but frees it with free() rather than g_free(), which provokes Coverity
complaints (CID 14323791432350). Use the correct free function.

Fixes: Coverity CID 1432379, CID 1432350
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210503165525.26221-2-peter.maydell@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/qtest/tpm-util.c

index b70cc32d600697b9c04ba4d2852a60ba1d5c0041..3a40ff3f96c267dfb2295587b24917d09d24da71 100644 (file)
@@ -289,6 +289,6 @@ void tpm_util_migration_start_qemu(QTestState **src_qemu,
 
     *dst_qemu = qtest_init(dst_qemu_args);
 
-    free(src_qemu_args);
-    free(dst_qemu_args);
+    g_free(src_qemu_args);
+    g_free(dst_qemu_args);
 }