mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu: Resolve Coverity FORWARD_NULL
If we end up at the cleanup lable before we've VIR_EXPAND_N the list, then calling virQEMUCapsFreeStringList() with a NULL proplist could theoretically deref proplist if nproplist was set. Coverity doesn't seem to acknowledge the relationship between proplist and nproplist assuming in virQEMUCapsFreeStringList that nproplist could be at least 1 and thus have a null deref. It only seems to follow the NULL proplist. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
8d44f924ce
commit
78fbc79d85
@ -1728,7 +1728,7 @@ virQEMUCapsParseDeviceStrObjectProps(const char *str,
|
||||
ret = nproplist;
|
||||
|
||||
cleanup:
|
||||
if (ret < 0)
|
||||
if (ret < 0 && proplist)
|
||||
virQEMUCapsFreeStringList(nproplist, proplist);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user