<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 15, 2021 at 2:46 PM Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sun, Mar 14, 2021 at 8:27 PM Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>> wrote:<br>
><br>
> On 13/3/21 2:18 am, Ryan Long wrote:<br>
> > CID 26032: Resource leak in rtems_shell_hexdump_rewrite().<br>
> ><br>
> > Closes #4296<br>
> > ---<br>
> >  cpukit/libmisc/shell/hexdump-parse.c | 3 +++<br>
> >  1 file changed, 3 insertions(+)<br>
> ><br>
> > diff --git a/cpukit/libmisc/shell/hexdump-parse.c b/cpukit/libmisc/shell/hexdump-parse.c<br>
> > index 88b9d56..5b56bbf 100644<br>
> > --- a/cpukit/libmisc/shell/hexdump-parse.c<br>
> > +++ b/cpukit/libmisc/shell/hexdump-parse.c<br>
> > @@ -462,6 +462,9 @@ isint2:                                   switch(fu->bcnt) {<br>
> >               (void)printf("\n");<br>
> >       }<br>
> >  #endif<br>
> > +#ifdef __rtems__<br>
> > +     free(nextpr);<br>
> > +#endif<br>
><br>
> I know this has not been done in imported code in rtems.git before but should we<br>
> adopt the libbsd standard of adding /* __rtems__ */ to the #else and #endif?<br>
><br>
<br>
Probably, but we also clone-and-own this shell/ code, and we should<br>
not bother with these #ifdefs in there. I think I have said this 3<br>
times this past week about shell/. The upstream does not want our<br>
changes, and we don't import from them anymore.<br></blockquote><div><br></div><div>Some of these files have massive changes and some don't. Ryan and </div><div>I looked at main_cp.c and it had at least 40 revisions since the version</div><div>we have. The same Coverity issue appeared to be present but the variable</div><div>names were changed and much clearer.</div><div><br></div><div>Chris imported this code initially. I'll trust his ruling on this since I assume</div><div>he is likely to either be the one to update it eventually or have to help someone</div><div>a lot. :)</div><div><br></div><div>And some of it is close enough that the ifdef's are worth it. Some isn't. </div><div>Hard call on the overall value.</div><div><br></div><div>--joel </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> Chris<br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div>