Do not leak memory used for binary filter.

This commit is contained in:
Andrey V. Elsukov 2019-05-13 14:07:02 +00:00
parent 699281b545
commit af1f58df99
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=347527

View File

@ -2628,11 +2628,17 @@ bpfd_free(epoch_context_t ctx)
if (d->bd_rfilter != NULL) {
p = __containerof((void *)d->bd_rfilter,
struct bpf_program_buffer, buffer);
#ifdef BPF_JITTER
p->func = d->bd_bfilter;
#endif
bpf_program_buffer_free(&p->epoch_ctx);
}
if (d->bd_wfilter != NULL) {
p = __containerof((void *)d->bd_wfilter,
struct bpf_program_buffer, buffer);
#ifdef BPF_JITTER
p->func = NULL;
#endif
bpf_program_buffer_free(&p->epoch_ctx);
}