[refpolicy] [PATCH v5] fc_sort: memory leakages

Guido Trentalancia guido at trentalancia.com
Wed Oct 4 20:59:31 UTC 2017


On Wed, 04/10/2017 at 11.05 -0700, William Roberts wrote:
> On Wed, Oct 4, 2017 at 2:41 AM, Guido Trentalancia via refpolicy
> <refpolicy at oss.tresys.com> wrote:
> > Hello Christopher.
> > 
> > The latest version (v5) has been tested not only with valgrind but
> > also with the Clang static analyzer and none of them reports any
> > error.
> > 
> > The Clang analyzer is the same one that was mentioned in the
> > original bug report, I have used the latest version 5.0.
> > 
> > I hope it helps.
> > 
> > Regards,
> > 
> > Guido
> > 
> > Il 03 ottobre 2017 03:21:38 CEST, Chris PeBenito <pebenito at ieee.org
> > > ha scritto:
> > > On 09/30/2017 06:44 PM, Guido Trentalancia via refpolicy wrote:
> > > > Avoid memory leakages in the fc_sort executable (now passes
> > > > all valgrind AND Clang static analyzer tests fine).
> > > > 
> > > > Some NULL pointer checks with or without associated error
> > > > reporting.
> > > > 
> > > > Some white space and comment formatting fixes.
> > > > 
> > > > Optimization: avoid unnecessary operations (unnecessary
> > > > memory allocation/deallocation and list copying).
> > > > 
> > > > Reverts 7821eb6f37d785ab6ac3bbdc39282c799ad22393 as such
> > > > trick is no longer needed, given that all memory leakages
> > > > have now been fixed.
> > > > 
> > > > This is the fifth version of this patch. Please do not use
> > > > the first version as it introduces a serious bug.
> > > > 
> > > > For reference, the original issue reported by the Cland
> > > > static analyzer is as follows:
> > > > 
> > > > support/fc_sort.c:494:6: warning: Potential leak of memory
> > > > pointed to by 'head'
> > > >              malloc(sizeof(file_context_bucket_t));
> > > 
> > > Bill, did your guys run this through their static analyzer? I'm
> > > inclined
> > > to merge this.

[...]

> 
> FYI Ill be on vacation for a week, so I won't be reachable on this
> matter. Thanks for the patch!
> 
> Bill

Thanks very much for reviewing it Bill ! I have now fixed the
whitespace as suggested by "git diff --check".

The new patch version will follow shortly...

Regards,

Guido


More information about the refpolicy mailing list