From: Joel Sherrill <joel@rtems.org>
To: Newlib <newlib@sourceware.org>
Subject: makedoc.c: Coverity Scan Issues
Date: Thu, 17 Jun 2021 13:06:58 -0500 [thread overview]
Message-ID: <CAF9ehCW6iJwt6Z2=n6i+a0ZxuQT4cbbOV3_KeqDxCUXcWXsYbg@mail.gmail.com> (raw)
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
next reply other threads:[~2021-06-17 18:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-17 18:06 Joel Sherrill [this message]
[not found] ` <BN3P110MB05635FBA2AA46EEA2E677F7D9A0E9@BN3P110MB0563.NAMP110.PROD.OUTLOOK.COM>
2021-06-17 18:28 ` Fw: " C Howland
2021-06-17 18:36 ` Joel Sherrill
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAF9ehCW6iJwt6Z2=n6i+a0ZxuQT4cbbOV3_KeqDxCUXcWXsYbg@mail.gmail.com' \
--to=joel@rtems.org \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).