提交 8d44f924 编写于 作者: J John Ferlan

virfile: Resolve Coverity RESOURCE_LEAK

With the virGetGroupList() change in place - Coverity further complains
that if we fail to virFork(), the groups will be leaked - which aha seems
to be the case. Adjust the logic to save off the -errno, free the groups,
and then return the value we saved
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 52e90b22
......@@ -2000,8 +2000,11 @@ virFileOpenForked(const char *path, int openflags, mode_t mode,
}
pid = virFork();
if (pid < 0)
return -errno;
if (pid < 0) {
ret = -errno;
VIR_FREE(groups);
return ret;
}
if (pid == 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册