提交 4a82ef92 编写于 作者: R Roman Bogorodskiy

Fix closedir usage in virNumaGetPages

virNumaGetPages calls closedir(dir) in cleanup and dir could
be NULL if we jump there from the failed opendir() call.

While it's not harmful on Linux, FreeBSD libc crashes [1], so
make sure that dir is not NULL before calling closedir.

1: http://lists.freebsd.org/pipermail/freebsd-standards/2014-January/002704.html
上级 60c343f6
......@@ -843,7 +843,8 @@ virNumaGetPages(int node,
VIR_FREE(tmp_free);
VIR_FREE(tmp_avail);
VIR_FREE(tmp_size);
closedir(dir);
if (dir)
closedir(dir);
VIR_FREE(path);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册