提交 d223cd76 编写于 作者: J Ján Tomko

Free groups in case of a partial match

If there are more than two regexes, but only one of them matches,
the matched groups would be leaked.
上级 cf4fb7d9
......@@ -2858,10 +2858,10 @@ virCommandRunRegex(virCommandPtr cmd,
if (i == nregex) {
if (((*func)(groups, data)) < 0)
goto cleanup;
for (j = 0; j < totgroups; j++)
VIR_FREE(groups[j]);
}
for (j = 0; j < ngroup; j++)
VIR_FREE(groups[j]);
}
ret = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册