[nas] [PATCH] Fix warnings about 'free' in nasd on GNU/Linux x86

Jon Trulson jon at radscan.com
Fri Aug 16 13:43:30 MDT 2013


On Fri, 16 Aug 2013, Erik Auerswald wrote:

> Hi,
>
> On 08/16/2013 09:22 PM, Jon Trulson wrote:
>> On Fri, 16 Aug 2013, Erik Auerswald wrote:
>>> the attached patch fixes the following warnings about 'free' when
>>> compiling NAS on GNU/Linux x86 (32 bit):
>>> 
[...]
>>> 
>>> I intend to apply the patch over the weekend unless somebody objects. :-)
>> 
>> I object your honor! :)
>> 
>> This is rather strange.  Including stdlib.h should be the correct fix.
>
> Indeed.
>
>> I did this, and it seems to work, but saw two other warnings that are
>> worrisome:
>> 
>> =-=-=-=-
>> connection.c: In function ‘AuthAudit’:
>> connection.c:1328:27: warning: format ‘%s’ expects argument of type
>> ‘char *’, but argument 4 has type ‘int’ [-Wformat]
>> connection.c:1328:27: warning: format ‘%s’ expects argument of type
>> ‘char *’, but argument 4 has type ‘int’ [-Wformat]
>> =-=-=-=-
>> 
>> This is basically inet_ntoa() returning an int, rather than the string
>> it should be returning.  This is coredump material on x86_64, so
>> clearly this function (in addition to free()) is not being prototyped
>> properly either.
>
> I have seen a lot of warnings on 64 bit Ubuntu 12.04, but have not yet 
> checked them.
>
>> Attached is my suggested patch that should resolve both issues on
>> linux at least.  Could you try it on your 32b machine?
>
> Works for me on 32 bit Debian and 64 bit Ubuntu machines. :-)
>

I'll commit this one then, thanks!


-- 
Jon Trulson

   "I was not genomed to alter reality."
       - Sonmi 451


More information about the nas mailing list