From 2d118d79e59576b2f1341798a56032b0bdf3b9cb Mon Sep 17 00:00:00 2001 From: Nitro Cao Date: Thu, 26 Oct 2023 16:24:25 +0800 Subject: [PATCH] fix(userspace/libscap): initialize bpf_engine.m_attached_progs.efd to -1 Signed-off-by: Nitro Cao --- userspace/libscap/engine/bpf/scap_bpf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/userspace/libscap/engine/bpf/scap_bpf.c b/userspace/libscap/engine/bpf/scap_bpf.c index f222d05806..01dc76c059 100644 --- a/userspace/libscap/engine/bpf/scap_bpf.c +++ b/userspace/libscap/engine/bpf/scap_bpf.c @@ -129,6 +129,7 @@ static struct bpf_engine* alloc_handle(scap_t* main_handle, char* lasterr_ptr) for(int j=0; j < BPF_PROG_ATTACHED_MAX; j++) { engine->m_attached_progs[j].fd = -1; + engine->m_attached_progs[j].efd = -1; } } return engine;