mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
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.
This commit is contained in:
parent
9d7254de43
commit
cabebc0c56
@ -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;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user