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

 Found by valgrind.

 Applies to trunk, S2_1 and S2_0. Tested only in trunk (If *path is
not initially sane value (such as NULL), this patch may lead to crash)


 - ML

diff -Nurd -X.diff_ignore freeciv/ai/aiferry.c freeciv/ai/aiferry.c
--- freeciv/ai/aiferry.c	2007-08-05 14:35:10.000000000 +0300
+++ freeciv/ai/aiferry.c	2007-08-07 12:07:17.000000000 +0300
@@ -445,6 +445,9 @@
 		     aunit->tile->y,
 		     aunit->moves_left);
 	    if (path) {
+             if (*path) {
+                pf_destroy_path(*path);
+              }
 	      *path = pf_next_get_path(search_map);
 	    }
             best_turns = turns;
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to