提交 f4f916a9 编写于 作者: P Peter Krempa

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
上级 0217089b
......@@ -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, &params,
&nparams, &maxparams) < 0)
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册