about summary refs log tree commit diff
path: root/libio/memstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/memstream.c')
-rw-r--r--libio/memstream.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libio/memstream.c b/libio/memstream.c
index ddcce676cb..e3c34d0b34 100644
--- a/libio/memstream.c
+++ b/libio/memstream.c
@@ -80,7 +80,9 @@ open_memstream (bufloc, sizeloc)
   new_f->fp._sf._sbf._f._lock = &new_f->lock;
 #endif
 
-  buf = ALLOC_BUF (_IO_BUFSIZ);
+  buf = malloc (_IO_BUFSIZ);
+  if (buf == NULL)
+    return NULL;
   _IO_init (&new_f->fp._sf._sbf._f, 0);
   _IO_JUMPS (&new_f->fp._sf._sbf._f) = &_IO_mem_jumps;
   _IO_str_init_static (&new_f->fp._sf._sbf._f, buf, _IO_BUFSIZ, buf);