From: John Ferlan Date: Fri, 6 Mar 2015 17:27:37 +0000 (-0500) Subject: qemu: Resolve Coverity CHECKED_RETURN issue X-Git-Tag: v1.2.14-rc1~245 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fcb13292b1833d67346af8abfcf8242c0d196eb3;p=thirdparty%2Flibvirt.git qemu: Resolve Coverity CHECKED_RETURN issue 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... --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d6a6853278..858bd87c71 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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);