[Freeciv-Dev] (PR#6444) Memory leaks in AI?
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=6444 >
Trying to reproduce this ticket's bug report, I failed but got
different memory leaks instead. Patch to fix some of them attached.
Jason: If you can still reproduce the original bug, please let me know.
To reproduce the new ones:
cre a
start
endgame
cre a
start
quit
FIXED:
==13724== 16152 bytes in 2 blocks are possibly lost in loss record 14 of 18
==13724== at 0x1B905A90: malloc (vg_replace_malloc.c:131)
==13724== by 0x804B6F4: fc_real_malloc (mem.c:75)
==13724== by 0x80E778E: player_init (player.c:142)
==13724== by 0x80AC260: game_init (game.c:289)
==13724== by 0x8050DD0: srv_main (srv_main.c:1643)
==13724== by 0x804A42A: main (civserver.c:242)
==13724== 244292 bytes in 335 blocks are definitely lost in loss record 17 of 18
==13724== at 0x1B905A90: malloc (vg_replace_malloc.c:131)
==13724== by 0x804B6F4: fc_real_malloc (mem.c:75)
==13724== by 0x80A1C8C: secfile_lookup_str_vec (registry.c:1494)
==13724== by 0x807FA8F: load_ruleset_nations (ruleset.c:2068)
==13724== by 0x8082D56: load_rulesets (ruleset.c:3122)
==13724== by 0x8051012: srv_main (srv_main.c:1746)
==13724== by 0x804A42A: main (civserver.c:242)
==14383== 564 bytes in 135 blocks are definitely lost in loss record 11 of 17
==14383== at 0x1B905A90: malloc (vg_replace_malloc.c:131)
==14383== by 0x804B6F4: fc_real_malloc (mem.c:75)
==14383== by 0x80A1D5A: secfile_get_secnames_prefix (registry.c:1623)
==14383== by 0x807F9DB: load_ruleset_nations (ruleset.c:2055)
==14383== by 0x8082D62: load_rulesets (ruleset.c:3123)
==14383== by 0x8051012: srv_main (srv_main.c:1746)
==14383== by 0x804A42A: main (civserver.c:242)
NOT FIXED:
==13724== 79 bytes in 8 blocks are definitely lost in loss record 8 of 18
==13724== at 0x1B905A90: malloc (vg_replace_malloc.c:131)
==13724== by 0x168FF9: xmalloc (in /usr/lib/libreadline.so.4.3)
==13724== by 0x1540D5: readline_internal_teardown (in
/usr/lib/libreadline.so.4.3)
==13724== by 0x165992: rl_callback_read_char (in /usr/lib/libreadline.so.4.3)
==13724== by 0x809389E: sniff_packets (sernet.c:648)
==13724== by 0x8050E64: srv_main (srv_main.c:1740)
==13724== by 0x804A42A: main (civserver.c:242)
==14513== 532 bytes in 133 blocks are definitely lost in loss record 11 of 17
==14513== at 0x1B905A90: malloc (vg_replace_malloc.c:131)
==14513== by 0x804B6F4: fc_real_malloc (mem.c:75)
==14513== by 0x80AAE96: ruleset_cache_init (speclist.h:82)
==14513== by 0x807DF98: load_building_names (ruleset.c:1240)
==14513== by 0x8081600: load_rulesets (ruleset.c:3099)
==14513== by 0x8051012: srv_main (srv_main.c:1746)
==14513== by 0x804A42A: main (civserver.c:242)
- Per
Index: server/ruleset.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/ruleset.c,v
retrieving revision 1.246
diff -u -r1.246 ruleset.c
--- server/ruleset.c 26 Apr 2005 06:57:37 -0000 1.246
+++ server/ruleset.c 26 Apr 2005 10:43:44 -0000
@@ -2059,6 +2059,7 @@
group = add_new_nation_group(name);
group->match = secfile_lookup_int_default(file, 0, "%s.match", groups[i]);
}
+ free(groups);
sec = secfile_get_secnames_prefix(file, "nation", &nval);
@@ -2071,6 +2072,7 @@
for (j = 0; j < dim; j++) {
pl->groups[j] = add_new_nation_group(groups[j]);
}
+ free(groups);
/* nation leaders */
Index: common/game.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/game.c,v
retrieving revision 1.206
diff -u -r1.206 game.c
--- common/game.c 23 Apr 2005 17:40:26 -0000 1.206
+++ common/game.c 26 Apr 2005 10:43:44 -0000
@@ -451,6 +451,7 @@
city_list_free(pplayer->cities);
if (is_barbarian(pplayer)) game.nbarbarians--;
+ free(pplayer->research);
}
/***************************************************************
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#6444) Memory leaks in AI?,
Per I. Mathisen <=
|
|