提交 1f1273c2 编写于 作者: J John Ferlan

util: Fix error path for virPCIGetVirtualFunctions

If we get to the error: label and clear out the *virtual_functions[]
pointers and then return w/ error to the caller - the caller has it's
own cleanup of the same array in the out: label which is keyed off the
value of num_virt_fns, which wasn't reset to 0 in the called function
leading to a possible problem.

Just clear the value (found by Coverity)
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 ee814d0e
......@@ -2573,6 +2573,7 @@ virPCIGetVirtualFunctions(const char *sysfs_path,
for (i = 0; i < *num_virtual_functions; i++)
VIR_FREE((*virtual_functions)[i]);
VIR_FREE(*virtual_functions);
*num_virtual_functions = 0;
goto cleanup;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册