[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 17/26] 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>
---
 src/util/virstring.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/util/virstring.c b/src/util/virstring.c
index b14f785..935f0c6 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -198,6 +198,9 @@ virStringFreeListCount(char **strings,
 {
     size_t i;
 
+    if (!strings)
+        return;
+
     for (i = 0; i < count; i++)
         VIR_FREE(strings[i]);
 
-- 
1.9.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]