summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2015-12-20 17:56:19 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2015-12-20 17:56:19 +0000
commit7ca5eca1186fff3caa06364aec31507478a8213a (patch)
tree9af3594cd937c82fab9f0c75692684946f245fd3 /sys/kern
parent8ae97979053f033843dc40af7b653b35da325157 (diff)
size for free, sent and reminded by Mathieu. also delete null check.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_event.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index d0346e98041..bac14ad6a52 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_event.c,v 1.69 2015/12/17 17:00:48 tedu Exp $ */
+/* $OpenBSD: kern_event.c,v 1.70 2015/12/20 17:56:18 tedu Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
@@ -1033,8 +1033,8 @@ knote_attach(struct knote *kn, struct filedesc *fdp)
fdp->fd_knlistsize * sizeof(struct klist));
memset(&list[fdp->fd_knlistsize], 0,
(size - fdp->fd_knlistsize) * sizeof(struct klist));
- if (fdp->fd_knlist != NULL)
- free(fdp->fd_knlist, M_TEMP, 0);
+ free(fdp->fd_knlist, M_TEMP,
+ fdp->fd_knlistsize * sizeof(struct klist));
fdp->fd_knlistsize = size;
fdp->fd_knlist = list;
}