]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: fix virBitmap allocation in virProcessInfoGetAffinity
authorJán Tomko <jtomko@redhat.com>
Thu, 29 Nov 2012 09:56:56 +0000 (10:56 +0100)
committerEric Blake <eblake@redhat.com>
Thu, 29 Nov 2012 17:10:08 +0000 (10:10 -0700)
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

index b8c60eb1d506da88a10e463582a576c0882907f0..b1db049fefa84c8e2fe71566480111f2d8ec015e 100644 (file)
@@ -140,7 +140,7 @@ realloc:
     }
 
     *map = virBitmapNew(maxcpu);
-    if (!map) {
+    if (!*map) {
         virReportOOMError();
         return -1;
     }