From: John Ferlan Date: Thu, 4 Sep 2014 21:11:57 +0000 (-0400) Subject: xen: Resolve Coverity NEGATIVE_RETURNS X-Git-Tag: CVE-2014-3633~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=947593f6e628f724607d51dfc346af6dc3edf01f;p=thirdparty%2Flibvirt.git xen: Resolve Coverity NEGATIVE_RETURNS Coverity notes that if the call to virBitmapParse() returns a negative value, then when we jump to the error label, the call to virCapabilitiesClearHostNUMACellCPUTopology() will have issues with the negative nb_cpus Signed-off-by: John Ferlan --- diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index d9e76fc2ab..f1322c438c 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -1112,7 +1112,8 @@ sexpr_to_xend_topology(const struct sexpr *root, virCapsPtr caps) parse_error: virReportError(VIR_ERR_XEN_CALL, "%s", _("topology syntax error")); error: - virCapabilitiesClearHostNUMACellCPUTopology(cpuInfo, nb_cpus); + if (nb_cpus > 0) + virCapabilitiesClearHostNUMACellCPUTopology(cpuInfo, nb_cpus); VIR_FREE(cpuInfo); return -1; }