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: <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [patches] freeing NULL ptrs
From: Justin Moore <justin@xxxxxxxxxxx>
Date: Fri, 17 Aug 2001 18:30:36 -0400 (EDT)

   More of the same.  All these patches can also be grabbed from
http://opus.dulug.duke.edu/~justin/public/FreeCiv/

> > PS. Would it be worth it to create a fc_free that ignores all NULL
> > pointers passed to it?
>
> Probably.  It might be helpful, too, to have that same function
> assert(ptr != NULL) first if compiled with debugging turned on, so
> that any instances where the code tries to free a NULL can be tracked
> down and, if necessary, fixed.

   The patch defining this function is included.  It'll be quite a series
of patches to switch everyone from using free() to fc_free(), though. :)

-jdm

Department of Computer Science, Duke University, Durham, NC 27708-0129
Email:  justin@xxxxxxxxxxx

Attachment: unittype-free-1.12.0.patch
Description: NULL pointer free

Attachment: mem.h-1.12.0.patch
Description: Text document

Attachment: mem.c-1.12.0.patch
Description: Text document


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