Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/ext2fs MALLOC()/FREE() are not to be used for variab...



details:   https://anonhg.NetBSD.org/src/rev/8946a117dfae
branches:  trunk
changeset: 495731:8946a117dfae
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Aug 03 20:29:26 2000 +0000

description:
MALLOC()/FREE() are not to be used for variable sized allocations.

diffstat:

 sys/ufs/ext2fs/ext2fs_lookup.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 76f54169f240 -r 8946a117dfae sys/ufs/ext2fs/ext2fs_lookup.c
--- a/sys/ufs/ext2fs/ext2fs_lookup.c    Thu Aug 03 20:10:45 2000 +0000
+++ b/sys/ufs/ext2fs/ext2fs_lookup.c    Thu Aug 03 20:29:26 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_lookup.c,v 1.15 2000/03/30 12:41:11 augustss Exp $      */
+/*     $NetBSD: ext2fs_lookup.c,v 1.16 2000/08/03 20:29:26 thorpej Exp $       */
 
 /* 
  * Modified for NetBSD 1.2E
@@ -172,8 +172,7 @@
        MALLOC(dirbuf, caddr_t, e2fs_count, M_TEMP, M_WAITOK);
        if (ap->a_ncookies) {
                nc = ncookies = e2fs_count / 16;
-               MALLOC(cookies, off_t *, sizeof (off_t) * ncookies, M_TEMP,
-                   M_WAITOK);
+               cookies = malloc(sizeof (off_t) * ncookies, M_TEMP, M_WAITOK);
                *ap->a_cookies = cookies;
        }
        memset(dirbuf, 0, e2fs_count);
@@ -213,7 +212,7 @@
        *ap->a_eofflag = VTOI(ap->a_vp)->i_e2fs_size <= uio->uio_offset;
        if (ap->a_ncookies) {
                if (error) {
-                       FREE(*ap->a_cookies, M_TEMP);
+                       free(*ap->a_cookies, M_TEMP);
                        *ap->a_ncookies = 0;
                        *ap->a_cookies = NULL;
                } else



Home | Main Index | Thread Index | Old Index