On Wed, Sep 18, 2019 at 04:53:07PM -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 second part of this change.
>
> Signed-off-by: Daniel Henrique Barboza <[email protected]>
> ---
[...]
> exit_monitor:
> @@ -3986,22 +3969,21 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr
> driver,
> qemuDomainObjPrivatePtr priv = vm->privateData;
> time_t now = time(NULL);
> const char *expire;
> - char *validTo = NULL;
> + VIR_AUTOFREE(char *) validTo = NULL;
> const char *connected = NULL;
> const char *password;
> int ret = -1;
>
> - if (!auth->passwd && !defaultPasswd) {
> - ret = 0;
> - goto cleanup;
> - }
> + if (!auth->passwd && !defaultPasswd)
> + return ret;
Not quite, originally ret == 0 upon return, now it's -1.
Erik
--
libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list