diff options
author | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2007-12-02 11:42:06 +0000 |
---|---|---|
committer | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2007-12-02 11:42:06 +0000 |
commit | 03ba1051654af9dc5b087e3b5fbaad204a6eaf36 (patch) | |
tree | 55b36fdeafc81c2047dc1742e3c5b79128356a71 /sys | |
parent | 56e8b22af2d7d8acd5cf38f4067bfd2fcd87acf1 (diff) |
Don't leak state if key allocation fails during add.
ok dlg@ henning@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/pf_ioctl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index 8ee80e7ba82..6224740489d 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.188 2007/12/02 11:39:45 pascoe Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.189 2007/12/02 11:42:05 pascoe Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1650,6 +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); error = ENOMEM; break; } |