aboutsummaryrefslogtreecommitdiff
path: root/malloc
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-07-18 21:22:57 +0000
committerUlrich Drepper <drepper@redhat.com>2001-07-18 21:22:57 +0000
commit91099cf415727b7ff4a920913fabde84dcf7f8fa (patch)
tree6387472ec99c3be6dc58e5bf155cf226fc856564 /malloc
parentDefine DEV_TTY_P. (diff)
downloadglibc-91099cf415727b7ff4a920913fabde84dcf7f8fa.tar.gz
glibc-91099cf415727b7ff4a920913fabde84dcf7f8fa.tar.bz2
glibc-91099cf415727b7ff4a920913fabde84dcf7f8fa.zip
Update.
2001-07-18 Ulrich Drepper <drepper@redhat.com> * libio/filedoalloc.c (_IO_file_doallocate): A few more minor cleanups and improvements. 2001-07-18 Andreas Schwab <schwab@suse.de> * posix/regex.c (WORDCHAR_P) [WCHAR]: Also return true for the underscore character. 2001-07-18 Jakub Jelinek <jakub@redhat.com> * malloc/malloc (new_heap): Don't call munmap for zero length. 2001-07-18 Ulrich Drepper <drepper@redhat.com> * 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.
Diffstat (limited to 'malloc')
-rw-r--r--malloc/malloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 5a5ea8fc71..c3040f4627 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