newlib/doc/makedoc.c: if realloc() fails, exit with an error message.
This commit is contained in:
parent
609f5a51c6
commit
90a72f27d5
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue