]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: Resolve Coverity CHECKED_RETURN issue
authorJohn Ferlan <jferlan@redhat.com>
Fri, 6 Mar 2015 17:27:37 +0000 (12:27 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 9 Mar 2015 12:11:49 +0000 (08:11 -0400)
By adding a call and check of return of virBitmapToData to the
IOThreads code, my Coverity checker lets me know qemuDomainHelperGetVcpus
also needs to check the status...

src/qemu/qemu_driver.c

index d6a68532784af3c62a2ec8341434b2082eee6e56..858bd87c71a36188a9efb130fa23fdc6b415c8a5 100644 (file)
@@ -1420,7 +1420,10 @@ qemuDomainHelperGetVcpus(virDomainObjPtr vm, virVcpuInfoPtr info, int maxinfo,
                 if (virProcessGetAffinity(priv->vcpupids[v],
                                           &map, maxcpu) < 0)
                     return -1;
-                virBitmapToData(map, &tmpmap, &tmpmapLen);
+                if (virBitmapToData(map, &tmpmap, &tmpmapLen) < 0) {
+                    virBitmapFree(map);
+                    return -1;
+                }
                 if (tmpmapLen > maplen)
                     tmpmapLen = maplen;
                 memcpy(cpumap, tmpmap, tmpmapLen);