Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: [FreeCiv-Cvs] rfalke: Add a "x = NULL;" after a "free(
Home

[Freeciv-Dev] Re: [FreeCiv-Cvs] rfalke: Add a "x = NULL;" after a "free(

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [FreeCiv-Cvs] rfalke: Add a "x = NULL;" after a "free(x);". This w...
From: Jason Short <vze2zq63@xxxxxxxxxxx>
Date: Sun, 24 Feb 2002 12:55:58 -0500
Reply-to: jdorje@xxxxxxxxxxxx

freeciv@xxxxxxxxxxxxxxxxxxx wrote:
This is an automated notification of a change to freeciv cvs, on Sun Feb 24 03:50:34 PST 2002 = Sun Feb 24 11:50:35 2002 (GMT)
by Raimar Falke <rf13@xxxxxxxxxxxxxxxxxxxxxx>

---- Files affected:

freeciv/client attribute.c climisc.c clinet.c control.c goto.c helpdata.c 
packhand.c tilespec.c
freeciv/client/agents cma_core.c
freeciv/common inputfile.c nation.c player.c registry.c shared.c
freeciv/server citytools.c gamehand.c gotohand.c mapgen.c plrhand.c sernet.c 
unithand.c unittools.c

---- Log message:

Add a "x = NULL;" after a "free(x);". This will avoid unintentional
de-referencing of the pointer.

Wasn't there a discussion before about a function

void fc_free(void** ptr)
{
  free(*ptr);
  *ptr = NULL;
}

?

Seems like using such a construct would make such things easier in the future.

(Sorry I didn't think of this _before_ you did all the work to change things...)

jason



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