]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
test_driver: Don't leak @group_name
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 31 Jan 2022 12:52:25 +0000 (13:52 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 1 Feb 2022 16:37:06 +0000 (17:37 +0100)
In testDomainSetBlockIoTune() the info.group_name is strdup()-ed
and just after the whole @info structure is passed to
virDomainDiskSetBlockIOTune() the @group_name member is set to
NULL. This creates a memleak, because
virDomainDiskSetBlockIOTune() creates its own copy of the string.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
src/test/test_driver.c

index 1504334c30da9b25cfa565c19b8df836e6433b7e..9e1fc659724d3898c0d0f7ba4212550cc4d5fb99 100644 (file)
@@ -4027,7 +4027,6 @@ testDomainSetBlockIoTune(virDomainPtr dom,
 #undef TEST_BLOCK_IOTUNE_MAX_CHECK
 
     virDomainDiskSetBlockIOTune(conf_disk, &info);
-    info.group_name = NULL;
 
     ret = 0;
  cleanup: