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

qemu_capabilities: Resolve Coverity NULL_RETURNS

Adjust the initialization of qemuCaps() to check for a NULL before
attempting to dereference like other callers/users do.
上级 9d7254de
...@@ -3349,10 +3349,13 @@ virQEMUCapsPtr virQEMUCapsNewForBinary(const char *binary, ...@@ -3349,10 +3349,13 @@ virQEMUCapsPtr virQEMUCapsNewForBinary(const char *binary,
uid_t runUid, uid_t runUid,
gid_t runGid) gid_t runGid)
{ {
virQEMUCapsPtr qemuCaps = virQEMUCapsNew(); virQEMUCapsPtr qemuCaps;
struct stat sb; struct stat sb;
int rv; int rv;
if (!(qemuCaps = virQEMUCapsNew()))
goto error;
if (VIR_STRDUP(qemuCaps->binary, binary) < 0) if (VIR_STRDUP(qemuCaps->binary, binary) < 0)
goto error; goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册