diff options
author | Joel Sherrill <joel@rtems.org> | 2021-06-17 16:48:47 -0500 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2021-06-17 16:48:47 -0500 |
commit | 90a72f27d5f724b496525b54a5d9f99cdcecbb9c (patch) | |
tree | c747179cf3099921735fd23f0f58900a3eee1f8a /newlib/doc | |
parent | 609f5a51c6e2c636996d6567fd5a4ec465a136f0 (diff) | |
download | newlib-90a72f27d5f724b496525b54a5d9f99cdcecbb9c.zip newlib-90a72f27d5f724b496525b54a5d9f99cdcecbb9c.tar.gz newlib-90a72f27d5f724b496525b54a5d9f99cdcecbb9c.tar.bz2 |
newlib/doc/makedoc.c: if realloc() fails, exit with an error message.
Diffstat (limited to 'newlib/doc')
-rw-r--r-- | newlib/doc/makedoc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/newlib/doc/makedoc.c b/newlib/doc/makedoc.c index 966349c..81aa6f9 100644 --- a/newlib/doc/makedoc.c +++ b/newlib/doc/makedoc.c @@ -135,6 +135,11 @@ catchar (string_type *buffer, char ch) { buffer->size *=2; buffer->ptr = realloc(buffer->ptr, buffer->size); + if (!buffer->ptr) + { + fprintf(stderr,"Can't allocate memory\n"); + exit(1); + } } buffer->ptr[buffer->write_idx ++ ] = ch; |