From: guido@trentalancia.com (Guido Trentalancia) Date: Wed, 04 Oct 2017 22:59:31 +0200 Subject: [refpolicy] [PATCH v5] fc_sort: memory leakages In-Reply-To: References: <1506643940.32317.6.camel@trentalancia.com> <1506703966.24492.1.camel@trentalancia.com> <1506710145.25223.1.camel@trentalancia.com> <1506727850.25420.6.camel@trentalancia.com> <1506751423.18819.1.camel@trentalancia.com> <1506798916.1659.3.camel@trentalancia.com> <1506811454.32049.1.camel@trentalancia.com> <2956012b-f494-40f2-75da-5d3dc9763d52@ieee.org> <8861CE28-A39E-4779-8322-F59D251F6528@trentalancia.com> Message-ID: <1507150771.4555.2.camel@trentalancia.com> To: refpolicy@oss.tresys.com List-Id: refpolicy.oss.tresys.com 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 > 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 > > 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