From 91099cf415727b7ff4a920913fabde84dcf7f8fa Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 18 Jul 2001 21:22:57 +0000 Subject: Update. 2001-07-18 Ulrich Drepper * libio/filedoalloc.c (_IO_file_doallocate): A few more minor cleanups and improvements. 2001-07-18 Andreas Schwab * posix/regex.c (WORDCHAR_P) [WCHAR]: Also return true for the underscore character. 2001-07-18 Jakub Jelinek * malloc/malloc (new_heap): Don't call munmap for zero length. 2001-07-18 Ulrich Drepper * libio/filedoalloc.c (_IO_file_doallocate): Use DEV_TTY_P if available to determine whether descriptor is for tty before calling isatty. * sysdeps/unix/sysv/linux/device-nrs.h: Define DEV_TTY_P. * sysdeps/generic/device-nrs.h: Likewise. --- malloc/malloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'malloc') diff --git a/malloc/malloc.c b/malloc/malloc.c index 5a5ea8f..c3040f4 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -2036,7 +2036,8 @@ new_heap(size) size_t size; if(p1 != MAP_FAILED) { p2 = (char *)(((unsigned long)p1 + (HEAP_MAX_SIZE-1)) & ~(HEAP_MAX_SIZE-1)); ul = p2 - p1; - munmap(p1, ul); + if (ul) + munmap(p1, ul); munmap(p2 + HEAP_MAX_SIZE, HEAP_MAX_SIZE - ul); } else { /* Try to take the chance that an allocation of only HEAP_MAX_SIZE -- cgit v1.1