Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [patches] freeing NULL ptrs
Home

[Freeciv-Dev] Re: [patches] freeing NULL ptrs

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: David Pfitzner <dwpfitzner@xxxxxxxxx>
Cc: Justin Moore <justin@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [patches] freeing NULL ptrs
From: Gaute B Strokkenes <gs234@xxxxxxxxx>
Date: Sat, 18 Aug 2001 05:27:48 +0200

On Fri, 17 Aug 2001, dwpfitzner@xxxxxxxxx wrote:
> Justin Moore <justin@xxxxxxxxxxx> wrote:
>> 
>>    Some allocation and freeing tools turned up a few places where
>>    we were freeing NULL pointers in common/registry.c and
>>    server/ruleset.c.  Patches against 1.12.0 included.  I had
>>    suspected there was some heap corruption going on, but didn't
>>    know exactly where until now.
>> 
>> -jdm
>> 
>> PS. Would it be worth it to create a fc_free that ignores all NULL
>> pointers passed to it?
> 
> I thought ANSI C requires that free(NULL) is a no-op?  K&R2 implies
> this.  Are there any compilers that we care about that behave 
> differently?

http://groups.google.com/groups?hl=en&safe=off&th=b640de69b11cf7dc,3

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
RELAX!! ... This is gonna be a HEALING EXPERIENCE!!  Besides,
 I work for DING DONGS!


[Prev in Thread] Current Thread [Next in Thread]