makedoc.c: Coverity Scan Issues

Joel Sherrill <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <CAF9ehCW6iJwt6Z2=n6i+a0ZxuQT4cbbOV3_KeqDxCUXcWXsYbg@mail.gmail.com>
Hi

Scan reports 3 issues in makedoc.c.

  One  is a memory leak around lines 1202 to 1282 because the variable word
holds memory allocated inside nextword. The method returns without freeing
the memory.    I think adding a free() is sufficient for this.

The others are from calling realloc() and not checking for NULL around line
137. Is checking for the NULL, printing a message, and exit(1), an OK thing
to do here?

Thanks.

--joel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.