1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-05 13:17:51 +03:00

qemuDomainDiskBackingStoreGetName: Eliminate temp variable

We can return the formatted string directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Peter Krempa 2020-07-15 12:01:39 +02:00
parent 4a19b7b832
commit 48b7c33cc7

View File

@ -11633,14 +11633,10 @@ char *
qemuDomainDiskBackingStoreGetName(virDomainDiskDefPtr disk,
unsigned int idx)
{
char *ret = NULL;
if (idx)
ret = g_strdup_printf("%s[%d]", disk->dst, idx);
else
ret = g_strdup(disk->dst);
return g_strdup_printf("%s[%d]", disk->dst, idx);
return ret;
return g_strdup(disk->dst);
}