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:
Jesper Dangaard Brouer
2022-04-22 10:43:55 +02:00
parent f14a20a15d
commit 7409814e44

View File

@@ -124,6 +124,7 @@ int test01_normal()
if (err) {
if (verbose)
printf("ERR(%d): Failed loading BTF info", err);
bpf_object__close(bpf_obj);
return EXIT_FAIL_BTF;
}
/* Teardown structs and memory again */