summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_usrreq.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-11-03 03:08:01 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-11-03 03:08:01 +0000
commit774f0773b4dd6e6d1c57c4a21a1b5c94c36848e1 (patch)
tree7bbf567ac5db4f4ce15690674823b6216809cbc8 /sys/kern/uipc_usrreq.c
parenta7ef034be229b99dee62d52b449fba299be46bb9 (diff)
pass size argument to free()
ok doug tedu
Diffstat (limited to 'sys/kern/uipc_usrreq.c')
-rw-r--r--sys/kern/uipc_usrreq.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index b45458469a1..9f9f5145b55 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_usrreq.c,v 1.77 2014/08/31 01:42:36 guenther Exp $ */
+/* $OpenBSD: uipc_usrreq.c,v 1.78 2014/11/03 03:08:00 deraadt Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */
/*
@@ -636,7 +636,7 @@ unp_drop(struct unpcb *unp, int errno)
so->so_pcb = NULL;
sofree(so);
m_freem(unp->unp_addr);
- free(unp, M_PCB, 0);
+ free(unp, M_PCB, sizeof(*unp));
}
}
@@ -813,14 +813,14 @@ morespace:
/* allocate a cluster and try again */
MCLGET(control, M_WAIT);
if ((control->m_flags & M_EXT) == 0) {
- free(tmp, M_TEMP, 0);
+ free(tmp, M_TEMP, control->m_len);
return (ENOBUFS); /* allocation failed */
}
/* copy the data back into the cluster */
cm = mtod(control, struct cmsghdr *);
memcpy(cm, tmp, control->m_len);
- free(tmp, M_TEMP, 0);
+ free(tmp, M_TEMP, control->m_len);
goto morespace;
}