aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/libqos
diff options
context:
space:
mode:
authorPan Nengyuan <pannengyuan@huawei.com>2020-02-03 10:59:35 +0800
committerThomas Huth <thuth@redhat.com>2020-02-04 09:00:57 +0100
commit77c24259b635c2c858e2b5ae61363843c4d88560 (patch)
tree880f0433f85eeade50b8da53616b0eacd619b29d /tests/qtest/libqos
parentab00cf4d73150822f24ca6cf762595a8c0cda452 (diff)
downloadqemu-77c24259b635c2c858e2b5ae61363843c4d88560.zip
qemu-77c24259b635c2c858e2b5ae61363843c4d88560.tar.gz
qemu-77c24259b635c2c858e2b5ae61363843c4d88560.tar.bz2
boot-order-test: fix memleaks in boot-order-test
It's not a big deal, but 'check qtest-ppc/ppc64' runs fail if sanitizers is enabled. The memory leak stack is as follow: Direct leak of 128 byte(s) in 4 object(s) allocated from: #0 0x7f11756f5970 in __interceptor_calloc (/lib64/libasan.so.5+0xef970) #1 0x7f1174f2549d in g_malloc0 (/lib64/libglib-2.0.so.0+0x5249d) #2 0x556af05aa7da in mm_fw_cfg_init /mnt/sdb/qemu/tests/libqos/fw_cfg.c:119 #3 0x556af059f4f5 in read_boot_order_pmac /mnt/sdb/qemu/tests/boot-order-test.c:137 #4 0x556af059efe2 in test_a_boot_order /mnt/sdb/qemu/tests/boot-order-test.c:47 #5 0x556af059f2c0 in test_boot_orders /mnt/sdb/qemu/tests/boot-order-test.c:59 #6 0x556af059f52d in test_pmac_oldworld_boot_order /mnt/sdb/qemu/tests/boot-order-test.c:152 #7 0x7f1174f46cb9 (/lib64/libglib-2.0.so.0+0x73cb9) #8 0x7f1174f46b73 (/lib64/libglib-2.0.so.0+0x73b73) #9 0x7f1174f46b73 (/lib64/libglib-2.0.so.0+0x73b73) #10 0x7f1174f46f71 in g_test_run_suite (/lib64/libglib-2.0.so.0+0x73f71) #11 0x7f1174f46f94 in g_test_run (/lib64/libglib-2.0.so.0+0x73f94) Reported-by: Euler Robot <euler.robot@huawei.com> Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com> Message-Id: <20200203025935.36228-1-pannengyuan@huawei.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/qtest/libqos')
-rw-r--r--tests/qtest/libqos/fw_cfg.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/qtest/libqos/fw_cfg.h b/tests/qtest/libqos/fw_cfg.h
index 13325cc..c6a7cf8 100644
--- a/tests/qtest/libqos/fw_cfg.h
+++ b/tests/qtest/libqos/fw_cfg.h
@@ -49,4 +49,6 @@ static inline void pc_fw_cfg_uninit(QFWCFG *fw_cfg)
io_fw_cfg_uninit(fw_cfg);
}
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(QFWCFG, mm_fw_cfg_uninit)
+
#endif