]> xenbits.xensource.com Git - libvirt.git/commitdiff
Resolve Coverity complaint in storagevolxml2argvtest
authorJán Tomko <jtomko@redhat.com>
Fri, 26 Jul 2013 11:10:12 +0000 (13:10 +0200)
committerJán Tomko <jtomko@redhat.com>
Fri, 26 Jul 2013 12:17:02 +0000 (14:17 +0200)
Ignore NULL pool in testSetVolumeType to silence Coverity,
even though we only call it with NULL pool when vol is also NULL.

(13) Event var_deref_model: Passing null pointer "inputpool" to
function "testSetVolumeType(virStorageVolDefPtr, virStoragePoolDefPtr)",
which dereferences it. [details]
Also see events: [assign_zero]

95    testSetVolumeType(inputvol, inputpool);

tests/storagevolxml2argvtest.c

index 7774617e600afa86ec18f9ff1ed5db9c7807d763..b1cf09f1d70aa89fa3a5c9067d4be5140af54b47 100644 (file)
@@ -16,7 +16,7 @@ static void
 testSetVolumeType(virStorageVolDefPtr vol,
                   virStoragePoolDefPtr pool)
 {
-    if (!vol)
+    if (!vol || !pool)
         return;
 
     switch (pool->type) {