diff options
Diffstat (limited to 'libio/filedoalloc.c')
-rw-r--r-- | libio/filedoalloc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libio/filedoalloc.c b/libio/filedoalloc.c index 918a24aa14..b51e910131 100644 --- a/libio/filedoalloc.c +++ b/libio/filedoalloc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993-2015 Free Software Foundation, Inc. +/* Copyright (C) 1993-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -91,8 +91,7 @@ local_isatty (int fd) */ int -_IO_file_doallocate (fp) - _IO_FILE *fp; +_IO_file_doallocate (_IO_FILE *fp) { _IO_size_t size; char *p; @@ -125,7 +124,9 @@ _IO_file_doallocate (fp) size = st.st_blksize; #endif } - ALLOC_BUF (p, size, EOF); + p = malloc (size); + if (__glibc_unlikely (p == NULL)) + return EOF; _IO_setb (fp, p, p + size, 1); return 1; } |