[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/20] tests/qtest/tpm-util.c: Free memory with correct free funct
From: |
Thomas Huth |
Subject: |
[PULL 12/20] tests/qtest/tpm-util.c: Free memory with correct free function |
Date: |
Fri, 14 May 2021 14:15:10 +0200 |
From: Peter Maydell <peter.maydell@linaro.org>
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 1432379, 1432350). 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 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/qtest/tpm-util.c b/tests/qtest/tpm-util.c
index b70cc32d60..3a40ff3f96 100644
--- a/tests/qtest/tpm-util.c
+++ b/tests/qtest/tpm-util.c
@@ -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);
}
--
2.27.0
- [PULL 11/20] tests/migration-test: Fix "true" vs true, (continued)
- [PULL 11/20] tests/migration-test: Fix "true" vs true, Thomas Huth, 2021/05/14
- [PULL 09/20] tests/qtest/ahci-test.c: Calculate iso_size with 64-bit arithmetic, Thomas Huth, 2021/05/14
- [PULL 08/20] util/compatfd.c: Replaced a malloc call with g_malloc., Thomas Huth, 2021/05/14
- [PULL 13/20] tests/qtest/rtc-test: Remove pointless NULL check, Thomas Huth, 2021/05/14
- [PULL 17/20] configure: Poison all current target-specific #defines, Thomas Huth, 2021/05/14
- [PULL 14/20] tests: Avoid side effects inside g_assert() arguments, Thomas Huth, 2021/05/14
- [PULL 15/20] include/sysemu: Poison all accelerator CONFIG switches in common code, Thomas Huth, 2021/05/14
- [PULL 16/20] migration: Move populate_vfio_info() into a separate file, Thomas Huth, 2021/05/14
- [PULL 12/20] tests/qtest/tpm-util.c: Free memory with correct free function,
Thomas Huth <=
- [PULL 19/20] pc-bios/s390-ccw: Fix inline assembly for older versions of Clang, Thomas Huth, 2021/05/14
- [PULL 18/20] tests/qtest/migration-test: Use g_autofree to avoid leaks on error paths, Thomas Huth, 2021/05/14
- [PULL 20/20] cirrus.yml: Fix the MSYS2 task, Thomas Huth, 2021/05/14
- Re: [PULL 00/20] CI, qtest, and misc patches, Peter Maydell, 2021/05/16