]> xenbits.xensource.com Git - libvirt.git/commitdiff
uuid: Fix coverity warning of unchecked return value
authorPeter Krempa <pkrempa@redhat.com>
Wed, 11 Jun 2014 09:40:44 +0000 (11:40 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 17 Jun 2014 08:40:20 +0000 (10:40 +0200)
Coverity checks for patterns of handling return values of functions.
Some recent addition must have tripped a threshold where coverity now
complains that we usually check the return value of virUUIDGenerate but
don't do it in one place. Add a check to make coverity happy.

tests/qemuxml2argvtest.c

index 24d104e2c0d227c68d250c37106b48e00ab47eb7..d8782d8d84d8b5f068f3ded47758b3fbdb0d6dab 100644 (file)
@@ -51,7 +51,9 @@ fakeSecretLookupByUsage(virConnectPtr conn,
     if (STRNEQ(usageID, "mycluster_myname"))
         return NULL;
 
-    virUUIDGenerate(uuid);
+    if (virUUIDGenerate(uuid) < 0)
+        return NULL;
+
     return virGetSecret(conn, uuid, usageType, usageID);
 }