Re: Fw: makedoc.c: Coverity Scan Issues
C Howland <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <CANk6obQ++XtkOc8f9h5fb76Btq-Eq+xXLzkTVXmpQyfDdmoyqQ@mail.gmail.com> |
> > ------------------------------ > *From:* Newlib <[email protected]> on > behalf of Joel Sherrill <[email protected]> > *Sent:* Thursday, June 17, 2021 2:06 PM > *To:* Newlib <[email protected]> > *Subject:* makedoc.c: Coverity Scan Issues > > > 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? > > Yes, that sounds good. (Seems very unlikely it would ever happen, anyway.) Craig > Thanks. > > --joel > > >