Skip to content

Commit 7409814

Browse files
committed
btf_unit_test: Fix small leak
If init_btf_info_via_bpf_object() fails, then we should release bpf_object. Signed-off-by: Jesper Dangaard Brouer <[email protected]>
1 parent f14a20a commit 7409814

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

AF_XDP-interaction/btf_unit_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ int test01_normal()
124124
if (err) {
125125
if (verbose)
126126
printf("ERR(%d): Failed loading BTF info", err);
127+
bpf_object__close(bpf_obj);
127128
return EXIT_FAIL_BTF;
128129
}
129130
/* Teardown structs and memory again */

0 commit comments

Comments
 (0)