mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 01:34:11 +03:00
virQEMUCapsInitQMPArch: Refactor cleanup
Switch to using the 'g_auto*' helpers. Signed-off-by: Yi Li <yili@winhong.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
16634feb1d
commit
7dfa87aed3
@ -5044,23 +5044,18 @@ static int
|
||||
virQEMUCapsInitQMPArch(virQEMUCapsPtr qemuCaps,
|
||||
qemuMonitorPtr mon)
|
||||
{
|
||||
char *archstr = NULL;
|
||||
int ret = -1;
|
||||
g_autofree char *archstr = NULL;
|
||||
|
||||
if (!(archstr = qemuMonitorGetTargetArch(mon)))
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
if ((qemuCaps->arch = virQEMUCapsArchFromString(archstr)) == VIR_ARCH_NONE) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unknown QEMU arch %s"), archstr);
|
||||
goto cleanup;
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(archstr);
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user