mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
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)
|
||||
flags |= VIR_DOMAIN_AFFECT_LIVE;
|
||||
|
||||
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
|
||||
return false;
|
||||
|
||||
if (vshCommandOptStringReq(ctl, cmd, "enable", &enable) < 0 ||
|
||||
vshCommandOptStringReq(ctl, cmd, "disable", &disable) < 0)
|
||||
return false;
|
||||
|
||||
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
|
||||
return false;
|
||||
|
||||
if (enable && virshParseEventStr(enable, true, ¶ms,
|
||||
&nparams, &maxparams) < 0)
|
||||
goto cleanup;
|
||||
|
Loading…
x
Reference in New Issue
Block a user