Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2005:
[Freeciv-Dev] (PR#13135) Fix valgrind error on signal free
Home

[Freeciv-Dev] (PR#13135) Fix valgrind error on signal free

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13135) Fix valgrind error on signal free
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Wed, 18 May 2005 06:37:59 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13135 >

What the subject says. Needs testing.

Reported by Jason.

Index: server/scripting/script_signal.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/scripting/script_signal.c,v
retrieving revision 1.8
diff -u -u -r1.8 script_signal.c
--- server/scripting/script_signal.c    11 May 2005 14:57:10 -0000      1.8
+++ server/scripting/script_signal.c    18 May 2005 13:01:40 -0000
@@ -222,8 +222,10 @@
 
     signal_callback_list_unlink_all(signal->callbacks);
     signal_callback_list_free(signal->callbacks);
-    free(signal);
 
+    hash_delete_entry(signals, name);
+
+    free(signal);
     free(name);
   } else {
     freelog(LOG_ERROR, "Signal \"%s\" does not exist, so cannot be freed.",

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13135) Fix valgrind error on signal free, Vasco Alexandre da Silva Costa <=