bpf: fix memleak in restrict_fs_bpf

Memory allocated in bpf skeleton is not freed. Wrap ptr in _cleanup_.

Fixes: #21471
This commit is contained in:
Julia Kartseva
2021-11-24 09:37:33 +01:00
committed by Lennart Poettering
parent e18dadca24
commit 7ab3c86d63
+1 -1
View File
@@ -52,7 +52,7 @@ static bool bpf_can_link_lsm_program(struct bpf_program *prog) {
}
static int prepare_restrict_fs_bpf(struct restrict_fs_bpf **ret_obj) {
struct restrict_fs_bpf *obj = 0;
_cleanup_(restrict_fs_bpf_freep) struct restrict_fs_bpf *obj = NULL;
_cleanup_close_ int inner_map_fd = -1;
int r;