summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2009-11-11 10:31:45 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2009-11-11 10:31:45 +0000
commit46546e1fae517929fa8da281ffb9f61eebcf16bf (patch)
tree4ef095e0ed15ceee7b35546dd0691180171140a7
parent2bdf54bbc647d224f9e63b570bdf159d7310887f (diff)
Fix some memory leaks in error cases.
Found by parfait. ok henning@
-rw-r--r--sys/net/pf_ioctl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index 369d09b7869..5817b570942 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.224 2009/11/03 17:41:02 claudio Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.225 2009/11/11 10:31:44 jsg Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -2720,6 +2720,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
for (i = 0; i < PF_LIMIT_MAX; i++) {
if (((struct pool *)pf_pool_limits[i].pp)->pr_nout >
pf_pool_limits[i].limit_new) {
+ free(table, M_TEMP);
+ free(ioe, M_TEMP);
error = EBUSY;
goto fail;
}
@@ -2768,6 +2770,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
pf_pool_limits[i].limit &&
pool_sethardlimit(pf_pool_limits[i].pp,
pf_pool_limits[i].limit_new, NULL, 0) != 0) {
+ free(table, M_TEMP);
+ free(ioe, M_TEMP);
error = EBUSY;
goto fail; /* really bad */
}