]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virstring: Resolve Coverity FORWARD_NULL
authorJohn Ferlan <jferlan@redhat.com>
Thu, 4 Sep 2014 20:37:11 +0000 (16:37 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 11 Sep 2014 12:10:13 +0000 (08:10 -0400)
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

index b14f785f13312af61bf72d4d4b9c17626f586ed0..935f0c6755304f9f9ec2b0e8883232bfe5c34c26 100644 (file)
@@ -198,6 +198,9 @@ virStringFreeListCount(char **strings,
 {
     size_t i;
 
+    if (!strings)
+        return;
+
     for (i = 0; i < count; i++)
         VIR_FREE(strings[i]);