+/* $NetBSD: malloc.c,v 1.6 1996/01/17 02:45:25 jtc Exp $ */
+
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved.
*/
#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)malloc.c 5.11 (Berkeley) 2/23/91";*/
-static char *rcsid = "$Id: malloc.c,v 1.1.1.1 1995/10/18 08:42:18 deraadt Exp $";
+#if 0
+static char *sccsid = "from: @(#)malloc.c 5.11 (Berkeley) 2/23/91";
+#else
+static char *rcsid = "$NetBSD: malloc.c,v 1.6 1996/01/17 02:45:25 jtc Exp $";
+#endif
#endif /* LIBC_SCCS and not lint */
/*
if (cp == NULL)
return (malloc(nbytes));
+ if (nbytes == 0) {
+ free (cp);
+ return NULL;
+ }
op = (union overhead *)((caddr_t)cp - sizeof (union overhead));
if (op->ov_magic == MAGIC) {
was_alloced++;