On Wed, Sep 18, 2019 at 04:53:06PM -0300, Daniel Henrique Barboza wrote:
Using VIR_AUTOFREE() spare us from calling VIR_VREE() and
sometimes a whole 'cleanup' label can be erased as well.
There are quite a few strings in qemu_hotplug.c to be
auto-freed. This is the first part of this change.
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
[...]
@@ -517,7 +507,7 @@ qemuDomainChangeMediaBlockdev(virQEMUDriverPtr
driver,
qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
VIR_AUTOPTR(qemuBlockStorageSourceChainData) newbackend = NULL;
VIR_AUTOPTR(qemuBlockStorageSourceChainData) oldbackend = NULL;
- char *nodename = NULL;
+ VIR_AUTOFREE(char *) nodename = NULL;
int rc;
int ret = -1;
@@ -572,7 +562,6 @@ qemuDomainChangeMediaBlockdev(virQEMUDriverPtr driver,
ret = 0;
cleanup:
^This cleanup label can be dropped as well after the change.
Erik