Follow-up Comment #3, bug #15305 (project freeciv):
> I guess it wasn't a very good patch.
I would not say that. It is good to know that here a call to free() is
> The original code was written by jdorje and glip back in 2004.
> Hopefully they can tell us what is the right thing to do.
I found an older reference in the changelog:
> Tue Jun 15 11:46:47 1999 David Pfitzner <d...@mso.anu.edu.au>:
> * client/packhand.c, common/map.c, common/map.h,
> server/mapgen.c, server/mapgen.h, server/maphand.c: Renamed
> init_workmap() in mapgen.c to map_allocate(), and moved to
> map.c. Replaced duplicated code in
> packhand.c/handle_map_info() with call to map_allocate(). In
> map_allocate(), use realloc instead of malloc, for client.
> (Previously there was a memory leak here in client when
> reconnecting multiple times to a running game).
So realloc() was used to prevent a memory leak in the client. If you want to
go on with your patch, you need to ensure that the allocation of these
variables are matched with a call to free().
Reply to this item at:
Nachricht geschickt von/durch Gna!
Freeciv-dev mailing list