qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

test-vmstate: Fix memleaks in test_load_qlist

There is memleak in test_load_qlist().It's not a big deal,
but test-vmstate will fail if sanitizers is enabled.

In addition, "ret" is written twice with the same value
in test_gtree_load_iommu().

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>

authored by

Chen Qun and committed by
Juan Quintela
a6fbd637 600fe89d

+2 -4
+2 -4
tests/test-vmstate.c
··· 1241 1241 TestGTreeIOMMU *orig_iommu = create_iommu(); 1242 1242 QEMUFile *fsave, *fload; 1243 1243 char eof; 1244 - int ret; 1245 1244 1246 1245 fsave = open_test_file(true); 1247 1246 qemu_put_buffer(fsave, iommu_dump, sizeof(iommu_dump)); ··· 1250 1249 1251 1250 fload = open_test_file(false); 1252 1251 vmstate_load_state(fload, &vmstate_iommu, dest_iommu, 1); 1253 - ret = qemu_file_get_error(fload); 1254 1252 eof = qemu_get_byte(fload); 1255 - ret = qemu_file_get_error(fload); 1256 - g_assert(!ret); 1253 + g_assert(!qemu_file_get_error(fload)); 1257 1254 g_assert_cmpint(orig_iommu->id, ==, dest_iommu->id); 1258 1255 g_assert_cmpint(eof, ==, QEMU_VM_EOF); 1259 1256 ··· 1395 1392 compare_containers(orig_container, dest_container); 1396 1393 free_container(orig_container); 1397 1394 free_container(dest_container); 1395 + qemu_fclose(fload); 1398 1396 } 1399 1397 1400 1398 typedef struct TmpTestStruct {