提交 f9799f1a 编写于 作者: J John Ferlan

xend: Fix a memory leak found by Coverity

Commit id '87b4c10c' moved the VIR_ALLOC_N, but didn't check if 'cpuset'
had been allocated on failure.
上级 d951c1a0
...@@ -1127,8 +1127,10 @@ sexpr_to_xend_topology(const struct sexpr *root, virCapsPtr caps) ...@@ -1127,8 +1127,10 @@ sexpr_to_xend_topology(const struct sexpr *root, virCapsPtr caps)
goto error; goto error;
} }
if (VIR_ALLOC_N(cpuInfo, numCpus) < 0) if (VIR_ALLOC_N(cpuInfo, numCpus) < 0) {
virBitmapFree(cpuset);
goto memory_error; goto memory_error;
}
for (n = 0, cpu = 0; cpu < numCpus; cpu++) { for (n = 0, cpu = 0; cpu < numCpus; cpu++) {
bool used; bool used;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册