use libiberty xmalloc in bfd/doc/chew.c
authorAlan Modra <amodra@gmail.com>
Mon, 30 May 2022 07:34:39 +0000 (17:04 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 30 May 2022 07:34:39 +0000 (17:04 +0930)
commit7273d78f3f7ae3701512f1ff423430f51b011ece
tree53d5096b48a68232ce5a476df4a222e4f07586d8
parentf43ffe07b1e5c3fe8c0f55e33d047e64b7bdb624
use libiberty xmalloc in bfd/doc/chew.c

Catch out of memory.

* doc/chew.c: Include libibery.h.
(init_string_with_size, nextword): Replace malloc with xmalloc.
(newentry, add_to_definition): Likewise.
(catchar, catbuf): Replace realloc with xrealloc.
(add_intrinsic): Replace strdup with xstrdup.
* doc/local.mk (LIBIBERTY): Define.
(chew): Link against libiberty.
* Makefile.in: Regenerate.
bfd/Makefile.in
bfd/doc/chew.c
bfd/doc/local.mk