MFC: r205858

Check the pointer to JIT binary filter before its de-allocation.
This commit is contained in:
Jung-uk Kim 2010-04-05 17:32:49 +00:00
parent 02b5123ee3
commit 7493cc345a

View file

@ -1865,13 +1865,14 @@ bpf_freed(struct bpf_d *d)
* free.
*/
bpf_free(d);
if (d->bd_rfilter) {
if (d->bd_rfilter != NULL) {
free((caddr_t)d->bd_rfilter, M_BPF);
#ifdef BPF_JITTER
bpf_destroy_jit_filter(d->bd_bfilter);
if (d->bd_bfilter != NULL)
bpf_destroy_jit_filter(d->bd_bfilter);
#endif
}
if (d->bd_wfilter)
if (d->bd_wfilter != NULL)
free((caddr_t)d->bd_wfilter, M_BPF);
mtx_destroy(&d->bd_mtx);
}