Source-Changes-HG archive

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

[src/trunk]: src/bin/sh Wrap malloc() calls with an INTOFF/INTON pair. Fixes...



details:   https://anonhg.NetBSD.org/src/rev/fc3ec4b18c84
branches:  trunk
changeset: 498368:fc3ec4b18c84
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Sat Oct 21 04:37:17 2000 +0000

description:
Wrap malloc() calls with an INTOFF/INTON pair.  Fixes PR 8414.

diffstat:

 bin/sh/memalloc.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 5eed71121d9f -r fc3ec4b18c84 bin/sh/memalloc.c
--- a/bin/sh/memalloc.c Sat Oct 21 00:55:23 2000 +0000
+++ b/bin/sh/memalloc.c Sat Oct 21 04:37:17 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: memalloc.c,v 1.21 1998/01/31 12:36:17 christos Exp $   */
+/*     $NetBSD: memalloc.c,v 1.22 2000/10/21 04:37:17 mycroft Exp $    */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)memalloc.c 8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: memalloc.c,v 1.21 1998/01/31 12:36:17 christos Exp $");
+__RCSID("$NetBSD: memalloc.c,v 1.22 2000/10/21 04:37:17 mycroft Exp $");
 #endif
 #endif /* not lint */
 
@@ -65,7 +65,10 @@
 {
        pointer p;
 
-       if ((p = malloc(nbytes)) == NULL)
+       INTOFF;
+       p = malloc(nbytes);
+       INTON;
+       if (p == NULL)
                error("Out of space");
        return p;
 }



Home | Main Index | Thread Index | Old Index