Author: cazfi Date: Wed Jan 6 20:26:28 2016 New Revision: 31394 URL: http://svn.gna.org/viewcvs/freeciv?rev=31394&view=rev Log: Fixed choice structure leak from kill_something_with()
See bug #24278 Modified: trunk/ai/default/advmilitary.c Modified: trunk/ai/default/advmilitary.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/advmilitary.c?rev=31394&r1=31393&r2=31394&view=diff ============================================================================== --- trunk/ai/default/advmilitary.c (original) +++ trunk/ai/default/advmilitary.c Wed Jan 6 20:26:28 2016 @@ -1303,6 +1303,12 @@ } cleanup: + if (best_choice != choice) { + /* It was not taken to use. + * This hackery needed since 'goto cleanup:' might skip + * sensible points to do adv_free_choice(). */ + adv_free_choice(best_choice); + } if (NULL != ferry_map) { pf_map_destroy(ferry_map); } _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits