From: Ján Tomko Date: Thu, 29 Nov 2012 09:56:56 +0000 (+0100) Subject: util: fix virBitmap allocation in virProcessInfoGetAffinity X-Git-Tag: CVE-2012-3411~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7730257db30972a6f4db8d582b232b240b2a06b8;p=thirdparty%2Flibvirt.git util: fix virBitmap allocation in virProcessInfoGetAffinity Found by coverity: Error: REVERSE_INULL (CWE-476): libvirt-0.10.2/src/util/processinfo.c:141: deref_ptr: Directly dereferencing pointer "map". libvirt-0.10.2/src/util/processinfo.c:142: check_after_deref: Null-checking "map" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. --- diff --git a/src/util/processinfo.c b/src/util/processinfo.c index b8c60eb1d5..b1db049fef 100644 --- a/src/util/processinfo.c +++ b/src/util/processinfo.c @@ -140,7 +140,7 @@ realloc: } *map = virBitmapNew(maxcpu); - if (!map) { + if (!*map) { virReportOOMError(); return -1; }