Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10666) memory leak with parent_nations
Home

[Freeciv-Dev] (PR#10666) memory leak with parent_nations

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10666) memory leak with parent_nations
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Oct 2004 10:42:45 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10666 >

==4951== 712 bytes in 84 blocks are definitely lost in loss record 10 of 16
==4951==    at 0x1B906EDD: malloc (vg_replace_malloc.c:131)
==4951==    by 0x804B512: fc_real_malloc (mem.c:79)
==4951==    by 0x808CB24: load_ruleset_nations (ruleset.c:2500)
==4951==    by 0x808F145: load_rulesets (ruleset.c:3229)
==4951==    by 0x8051E5F: srv_loop (srv_main.c:1695)
==4951==    by 0x8051D4B: srv_main (srv_main.c:1647)
==4951==    by 0x804A94E: main (civserver.c:170)

This patch should fix it.

jason

Index: common/nation.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/nation.c,v
retrieving revision 1.39
diff -u -r1.39 nation.c
--- common/nation.c     25 Jun 2004 23:43:01 -0000      1.39
+++ common/nation.c     21 Oct 2004 17:42:38 -0000
@@ -238,6 +238,11 @@
     p->civilwar_nations = NULL;
   }
 
+  if (p->parent_nations) {
+    free(p->parent_nations);
+    p->parent_nations = NULL;
+  }
+
   nation_city_names_free(p->city_names);
   p->city_names = NULL;
 }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10666) memory leak with parent_nations, Jason Short <=