diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2024-08-20 15:49:06 +0100 |
---|---|---|
committer | Fabiano Rosas <farosas@suse.de> | 2024-09-03 16:24:33 -0300 |
commit | f0d74774b04a518671789a4a1afa504911a8020a (patch) | |
tree | bee3324964fa87feedb581dc2b5bf280f97d933a /tests/avocado/intel_iommu.py | |
parent | 0fa2cf819df3f1097a94a6e839c230adefaa82a3 (diff) | |
download | qemu-f0d74774b04a518671789a4a1afa504911a8020a.zip qemu-f0d74774b04a518671789a4a1afa504911a8020a.tar.gz qemu-f0d74774b04a518671789a4a1afa504911a8020a.tar.bz2 |
tests/qtest/migration-test: Fix leaks in calc_dirtyrate_ready()
In calc_dirtyrate_ready() we g_strdup() a string but then never free it:
Direct leak of 19 byte(s) in 2 object(s) allocated from:
#0 0x55ead613413e in malloc (/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/asan/tests/qtest/migration-test+0x22f13e) (BuildId: e7cd5c37b2987a1af682b43ee5240b98bb316737)
#1 0x7f7a13d39738 in g_malloc debian/build/deb/../../../glib/gmem.c:128:13
#2 0x7f7a13d4e583 in g_strdup debian/build/deb/../../../glib/gstrfuncs.c:361:17
#3 0x55ead6266f48 in calc_dirtyrate_ready tests/qtest/migration-test.c:3409:14
#4 0x55ead62669fe in wait_for_calc_dirtyrate_complete tests/qtest/migration-test.c:3422:13
#5 0x55ead6253df7 in test_vcpu_dirty_limit tests/qtest/migration-test.c:3562:9
#6 0x55ead626a407 in migration_test_wrapper tests/qtest/migration-helpers.c:456:5
We also fail to unref the QMP rsp_return, so we leak that also.
Rather than duplicating the string, use the in-place value from
the qdict, and then unref the qdict.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'tests/avocado/intel_iommu.py')
0 files changed, 0 insertions, 0 deletions