From 1abfef9088388ae21a9070482e8e30b313aa2f22 Mon Sep 17 00:00:00 2001 From: Paul Moore Date: Wed, 15 Jul 2020 14:47:04 -0400 Subject: bpf: correctly check for zmalloc() failures in _gen_bpf_init_bintree() Identified via Coverity, make sure we are checking the correct pointer depth when dealing with double pointers. Signed-off-by: Paul Moore --- src/gen_bpf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gen_bpf.c b/src/gen_bpf.c index 02ea3f6..f7b6eca 100644 --- a/src/gen_bpf.c +++ b/src/gen_bpf.c @@ -1374,12 +1374,12 @@ static int _gen_bpf_init_bintree(uint64_t **bintree_hashes, ((*bintree_levels) - 1)) - syscall_cnt; *bintree_hashes = zmalloc(sizeof(uint64_t) * (*bintree_levels)); - if (bintree_hashes == NULL) + if (*bintree_hashes == NULL) return -ENOMEM; *bintree_syscalls = zmalloc(sizeof(unsigned int) * (*bintree_levels)); - if (bintree_syscalls == NULL) + if (*bintree_syscalls == NULL) return -ENOMEM; for (i = 0; i < *bintree_levels; i++) { -- cgit v1.2.1