diff options
author | 2007-12-02 11:42:05 +0000 | |
---|---|---|
committer | 2007-12-02 11:42:05 +0000 | |
commit | 0bb00322b1e2d2e7973e65b1b729f7007a45c6b6 (patch) | |
tree | 06e02bc8d03fb5103ec2254f79ce36c2258ab220 | |
parent | Set expiry timestamp when importing a state, otherwise it expires on the (diff) | |
download | wireguard-openbsd-0bb00322b1e2d2e7973e65b1b729f7007a45c6b6.tar.xz wireguard-openbsd-0bb00322b1e2d2e7973e65b1b729f7007a45c6b6.zip |
Don't leak state if key allocation fails during add.
ok dlg@ henning@
-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; } |