Re: [PATCH 19/28] domain_conf: use g_free in virDomainDiskSetBlockIOTune()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On a Thursday in 2020, Matt Coleman wrote:
Signed-off-by: Matt Coleman <matt@xxxxxxxxx>
---
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 25baa44a92..d71bd68682 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -31972,7 +31972,7 @@ virDomainDiskSetBlockIOTune(virDomainDiskDefPtr disk,

    tmp_group = g_strdup(info->group_name);


The tmp_group variable is not needed here. It's an artifact from back
when strdup could fail, to avoid the situation of freeing the old group
name without being able to copy the new one.

Jano

-    VIR_FREE(disk->blkdeviotune.group_name);
+    g_free(disk->blkdeviotune.group_name);
    disk->blkdeviotune = *info;
    disk->blkdeviotune.group_name = g_steal_pointer(&tmp_group);
}
--
2.27.0


Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux