[PATCH 2/6] util: fix virBitmap allocation in virProcessInfoGetAffinity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/util/processinfo.c b/src/util/processinfo.c
index b8c60eb..b1db049 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;
     }
-- 
1.7.8.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]