[uClibc-cvs] uClibc/libc/stdlib/malloc malloc.c,1.32,1.33
Erik Andersen
andersen at codepoet.org
Thu Jan 23 09:05:38 UTC 2003
Update of /var/cvs/uClibc/libc/stdlib/malloc
In directory winder:/tmp/cvs-serv1507/libc/stdlib/malloc
Modified Files:
malloc.c
Log Message:
Update malloc behavior on malloc(0) to be consistant with
malloc-930716 behavior, i.e. return a NULL.
Index: malloc.c
===================================================================
RCS file: /var/cvs/uClibc/libc/stdlib/malloc/malloc.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- malloc.c 21 Nov 2002 06:06:21 -0000 1.32
+++ malloc.c 23 Jan 2003 09:05:34 -0000 1.33
@@ -1,8 +1,8 @@
/*
* libc/stdlib/malloc/malloc.c -- malloc function
*
- * Copyright (C) 2002 NEC Corporation
- * Copyright (C) 2002 Miles Bader <miles at gnu.org>
+ * Copyright (C) 2002,03 NEC Electronics Corporation
+ * Copyright (C) 2002,03 Miles Bader <miles at gnu.org>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License. See the file COPYING.LIB in the main
@@ -183,6 +183,9 @@
if (__malloc_check)
__heap_check (&__malloc_heap, "malloc");
#endif
+
+ if (size == 0)
+ return 0;
return malloc_from_heap (size, &__malloc_heap);
}
More information about the uClibc-cvs
mailing list