Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/beace4465784
branches:  trunk
changeset: 495694:beace4465784
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Aug 03 03:38:39 2000 +0000

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

diffstat:

 sys/filecorefs/filecore_vnops.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r db1fc2397b2c -r beace4465784 sys/filecorefs/filecore_vnops.c
--- a/sys/filecorefs/filecore_vnops.c   Thu Aug 03 03:38:25 2000 +0000
+++ b/sys/filecorefs/filecore_vnops.c   Thu Aug 03 03:38:39 2000 +0000
@@ -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 @@
        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 @@
        if (cookies) {
                *ap->a_cookies = cookies;
                if (error) {
-                       FREE(cookies, M_TEMP);
+                       free(cookies, M_TEMP);
                        *ap->a_ncookies = 0;
                        *ap->a_cookies = NULL;
                }



Home | Main Index | Thread Index | Old Index