Author: sveinung
Date: Fri May 12 14:54:18 2017
New Revision: 35514

URL: http://svn.gna.org/viewcvs/freeciv?rev=35514&view=rev
Log:
Initialize kind before use in check.

Initialize action not enabled explanation kind so it has a value to check
even if a suitable target is present.

Found with Valgrind.

See hrm Bug #659109

Modified:
    trunk/server/unithand.c

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=35514&r1=35513&r2=35514&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Fri May 12 14:54:18 2017
@@ -811,6 +811,9 @@
   bool can_exist = can_unit_exist_at_tile(punit, unit_tile(punit));
   bool on_native = is_native_tile(unit_type_get(punit), unit_tile(punit));
   int action_custom;
+
+  /* Not know yet. (Initialize before the below check.) */
+  explnat->kind = ANEK_UNKNOWN;
 
   if (action_id != ACTION_ANY) {
     /* A specific action should have a suitable target. */


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to