]> git.pond.sub.org Git - empserver/commit
fire: Plug memory leak when missile defense sinks firing ships
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 22 Jul 2016 04:46:15 +0000 (06:46 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:09:18 +0000 (20:09 +0200)
commit25c96cc3acbe4b977a640963f8aaf5005465db99
tree849c5cac617d75fd06a3005ba85610b93b8e418e
parent656c3e764567370b78c69fb9017656bfba79ace1
fire: Plug memory leak when missile defense sinks firing ships

do_defdam() iterates over the list firing ships, applies return fire
to each, and frees its list element.  When it finds a ship that has
been sunk already, it skips it.  This also skips the free, leaking the
list element.  The leak goes back to flawed bug fix in Empire 2.

As far as I can see, missile defense is the only way a ship can be
sunk there.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/mfir.c