mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
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 <brouer@redhat.com>
This commit is contained in:
@@ -124,6 +124,7 @@ int test01_normal()
|
|||||||
if (err) {
|
if (err) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf("ERR(%d): Failed loading BTF info", err);
|
printf("ERR(%d): Failed loading BTF info", err);
|
||||||
|
bpf_object__close(bpf_obj);
|
||||||
return EXIT_FAIL_BTF;
|
return EXIT_FAIL_BTF;
|
||||||
}
|
}
|
||||||
/* Teardown structs and memory again */
|
/* Teardown structs and memory again */
|
||||||
|
Reference in New Issue
Block a user