1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-02 09:47:03 +03:00

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-23 15:38:11 -08:00 committed by Lennart Poettering
parent e18dadca24
commit 7ab3c86d63

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;