virsh: perf: Don't leak domain
After failing to parse the perf event list, the code would return failure without freeing the previously acquired object. Rearrange the code to avoid the problem. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1329046
This commit is contained in:
parent
0217089b89
commit
f4f916a9e3
@ -8623,13 +8623,13 @@ cmdPerf(vshControl *ctl, const vshCmd *cmd)
|
|||||||
if (live)
|
if (live)
|
||||||
flags |= VIR_DOMAIN_AFFECT_LIVE;
|
flags |= VIR_DOMAIN_AFFECT_LIVE;
|
||||||
|
|
||||||
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (vshCommandOptStringReq(ctl, cmd, "enable", &enable) < 0 ||
|
if (vshCommandOptStringReq(ctl, cmd, "enable", &enable) < 0 ||
|
||||||
vshCommandOptStringReq(ctl, cmd, "disable", &disable) < 0)
|
vshCommandOptStringReq(ctl, cmd, "disable", &disable) < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
|
||||||
|
return false;
|
||||||
|
|
||||||
if (enable && virshParseEventStr(enable, true, ¶ms,
|
if (enable && virshParseEventStr(enable, true, ¶ms,
|
||||||
&nparams, &maxparams) < 0)
|
&nparams, &maxparams) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user