]> git.pond.sub.org Git - empserver/commit
Fix memory leaks in plane interception
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 22 Mar 2008 18:43:38 +0000 (19:43 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 26 Mar 2008 21:08:15 +0000 (22:08 +0100)
commit6fe12d0b7fbeb03f9766cbdc6fda9a0763faec44
tree1ecd240b9107d8ed0ac67d101d911c76e2fb85bb
parentf7d55766758b2bfcf04a1f1079823ac9dbdcfb8f
Fix memory leaks in plane interception

Interception builds lists of planes that could intercept.  Only list
nodes for missiles were freed.  Broken since BSD Empire 1.1.

The fix frees interceptors that actually intercepted when
ac_intercept() returns, and the interceptors that didn't when
ac_encounter() returns.

The latter introduces a small bug: it passes planes that didn't fly to
pln_put().  pln_put() expects only planes that actually took off.
Same bug exists in air defense missions.  Luckily, it has no ill
effects.  To be fixed soon.
src/lib/subs/aircombat.c