diff options
author | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2007-12-02 11:53:07 +0000 |
---|---|---|
committer | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2007-12-02 11:53:07 +0000 |
commit | de3c6b8c2b430a19b7a22fb249e46e8d933ede16 (patch) | |
tree | 7570c70cdb991eb62110f7485bf128cdbb6f22f2 | |
parent | 03ba1051654af9dc5b087e3b5fbaad204a6eaf36 (diff) |
Don't put state key if pf_insert_state fails. pf_detach_state would have
put it for us already.
Also, fix cut-n-paste error in previous commit.
ok dlg@ henning@
-rw-r--r-- | sys/net/pf_ioctl.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index 6224740489d..e001cd22ccb 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.189 2007/12/02 11:42:05 pascoe Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.190 2007/12/02 11:53:06 pascoe Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1650,7 +1650,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) } bzero(s, sizeof(struct pf_state)); if ((sk = pf_alloc_state_key(s)) == NULL) { - pool_put(pf_state_pl, s); + pool_put(&pf_state_pl, s); error = ENOMEM; break; } @@ -1665,7 +1665,6 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) if (pf_insert_state(kif, s)) { pfi_kif_unref(kif, PFI_KIF_REF_NONE); pool_put(&pf_state_pl, s); - pool_put(&pf_state_key_pl, sk); error = ENOMEM; } break; |