Skip to content

Commit

Permalink
Fix bad null check
Browse files Browse the repository at this point in the history
Found by Facebook Infer static analysis tool

Signed-off-by: Casper Andersson <[email protected]>
  • Loading branch information
cappe987 committed Aug 14, 2023
1 parent cdea9f7 commit 9592200
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/libcapmon.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ void capmon_destroy(struct capmon *cm);
static int OBJ##_init(struct OBJ##_bpf **skel){\
int err;\
\
if (skel == NULL) \
return -EINVAL; \
/* Load and verify BPF application */\
*skel = OBJ##_bpf__open();\
if (!skel) {\
if (*skel == NULL) {\
ERR("failed to open and load BPF skeleton\n");\
return 1;\
}\
Expand Down

0 comments on commit 9592200

Please sign in to comment.