summaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-10-09 00:39:00 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-10-09 00:39:00 +0000
commit8ce55a0f744e69f90d6fa1eb07cbf54625b0f1e7 (patch)
tree3e74eff81eb1a2438a67c87f131b5d1bb66e9f2a /sys/ufs
parent7ddae76ac49454ccd29d55c595eb0dd0cc25bf97 (diff)
MALLOC+memset(,0,) -> malloc+M_ZERO. Don't forget FREE->free this time.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ext2fs/ext2fs_lookup.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_lookup.c b/sys/ufs/ext2fs/ext2fs_lookup.c
index ce4d3cb872a..f0e94df4fc1 100644
--- a/sys/ufs/ext2fs/ext2fs_lookup.c
+++ b/sys/ufs/ext2fs/ext2fs_lookup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_lookup.c,v 1.23 2007/06/17 20:15:25 jasper Exp $ */
+/* $OpenBSD: ext2fs_lookup.c,v 1.24 2007/10/09 00:38:59 krw Exp $ */
/* $NetBSD: ext2fs_lookup.c,v 1.16 2000/08/03 20:29:26 thorpej Exp $ */
/*
@@ -160,13 +160,12 @@ ext2fs_readdir(void *v)
auio.uio_segflg = UIO_SYSSPACE;
aiov.iov_len = e2fs_count;
auio.uio_resid = e2fs_count;
- MALLOC(dirbuf, caddr_t, e2fs_count, M_TEMP, M_WAITOK);
+ dirbuf = malloc(e2fs_count, M_TEMP, M_WAITOK | M_ZERO);
if (ap->a_ncookies) {
nc = ncookies = e2fs_count / 16;
cookies = malloc(sizeof (off_t) * ncookies, M_TEMP, M_WAITOK);
*ap->a_cookies = cookies;
}
- memset(dirbuf, 0, e2fs_count);
aiov.iov_base = dirbuf;
error = VOP_READ(ap->a_vp, &auio, 0, ap->a_cred);
@@ -199,7 +198,7 @@ ext2fs_readdir(void *v)
/* we need to correct uio_offset */
uio->uio_offset = off;
}
- FREE(dirbuf, M_TEMP);
+ free(dirbuf, M_TEMP);
*ap->a_eofflag = ext2fs_size(VTOI(ap->a_vp)) <= uio->uio_offset;
if (ap->a_ncookies) {
if (error) {