From 7730257db30972a6f4db8d582b232b240b2a06b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Thu, 29 Nov 2012 10:56:56 +0100 Subject: [PATCH] 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. --- src/util/processinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- GitLab