diff --git a/contrib/texinfo/makeinfo/makeinfo.c b/contrib/texinfo/makeinfo/makeinfo.c index ef892db00305..d709db439585 100644 --- a/contrib/texinfo/makeinfo/makeinfo.c +++ b/contrib/texinfo/makeinfo/makeinfo.c @@ -1199,6 +1199,13 @@ xrealloc (pointer, nbytes) else temp = (void *)realloc (pointer, nbytes); + if (nbytes && temp == (void *)NULL) + memory_error ("xrealloc", nbytes); + + return (temp); +} + + /* If EXIT_VALUE is zero, print the full usage message to stdout. Otherwise, just say to use --help for more info. Then exit with EXIT_VALUE. */