Author: ae
Date: Mon May 13 14:07:02 2019
New Revision: 347527
URL: https://svnweb.freebsd.org/changeset/base/347527

Log:
  Do not leak memory used for binary filter.

Modified:
  head/sys/net/bpf.c

Modified: head/sys/net/bpf.c
==============================================================================
--- head/sys/net/bpf.c  Mon May 13 13:45:28 2019        (r347526)
+++ head/sys/net/bpf.c  Mon May 13 14:07:02 2019        (r347527)
@@ -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);
        }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to