diff options
author | Paul Moore <paul@paul-moore.com> | 2020-07-15 14:47:04 -0400 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2020-07-15 14:51:28 -0400 |
commit | 1abfef9088388ae21a9070482e8e30b313aa2f22 (patch) | |
tree | 977c14a7e7cb291f43376dfb2929392f4a51c67a | |
parent | 43d63abc1ef2ae3e9386c4b1733a774575d144d8 (diff) | |
download | libseccomp-1abfef9088388ae21a9070482e8e30b313aa2f22.tar.gz |
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 <paul@paul-moore.com>
-rw-r--r-- | src/gen_bpf.c | 4 |
1 files 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++) { |