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, qemuDomainDiskBackingStoreGetName(virDomainDiskDefPtr disk,
unsigned int idx) unsigned int idx)
{ {
char *ret = NULL;
if (idx) if (idx)
ret = g_strdup_printf("%s[%d]", disk->dst, idx); return g_strdup_printf("%s[%d]", disk->dst, idx);
else
ret = g_strdup(disk->dst);
return ret; return g_strdup(disk->dst);
} }