mirror of https://gitee.com/openkylin/libvirt.git
virstring: Resolve Coverity FORWARD_NULL
Perhaps a false positive, but since Coverity doesn't understand the relationship between the 'count' and the 'strings', rather than leave the chance the on input 'strings' is NULL and causes a deref - just check for it and return Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
d3f0708e84
commit
114ebecd98
|
@ -198,6 +198,9 @@ virStringFreeListCount(char **strings,
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
if (!strings)
|
||||||
|
return;
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
VIR_FREE(strings[i]);
|
VIR_FREE(strings[i]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue