From 13c3e4c7bf54057b15a68e207606da02a7a2ca11 Mon Sep 17 00:00:00 2001 From: thorpej Date: Thu, 3 Aug 2000 03:38:39 +0000 Subject: [PATCH] MALLOC()/FREE() are not to be used for variable sized allocations. --- sys/filecorefs/filecore_vnops.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/filecorefs/filecore_vnops.c b/sys/filecorefs/filecore_vnops.c index d46bf3198a2d..1e8b054de913 100644 --- a/sys/filecorefs/filecore_vnops.c +++ b/sys/filecorefs/filecore_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: filecore_vnops.c,v 1.8 1999/08/03 20:19:18 wrstuden Exp $ */ +/* $NetBSD: filecore_vnops.c,v 1.9 2000/08/03 03:38:39 thorpej Exp $ */ /*- * Copyright (c) 1998 Andrew McMurry @@ -282,8 +282,7 @@ filecore_readdir(v) else { *ap->a_ncookies = 0; ncookies = uio->uio_resid/16; - MALLOC(cookies, off_t *, ncookies * sizeof(off_t), M_TEMP, - M_WAITOK); + cookies = malloc(ncookies * sizeof(off_t), M_TEMP, M_WAITOK); } for (; ; i++) { @@ -335,7 +334,7 @@ out: if (cookies) { *ap->a_cookies = cookies; if (error) { - FREE(cookies, M_TEMP); + free(cookies, M_TEMP); *ap->a_ncookies = 0; *ap->a_cookies = NULL; }