diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 9015c43ba2e6928c94f195098af4013105a003b5..9913d703ec5cd03cc21935615b2f9cd38080644b 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -8645,17 +8645,15 @@ static const vshCmdOptDef opts_inject_nmi[] = { static bool cmdInjectNMI(vshControl *ctl, const vshCmd *cmd) { - virDomainPtr dom; - bool ret = true; + VIR_AUTOPTR(virshDomain) dom = NULL; if (!(dom = virshCommandOptDomain(ctl, cmd, NULL))) return false; if (virDomainInjectNMI(dom, 0) < 0) - ret = false; + return false; - virshDomainFree(dom); - return ret; + return true; } /*