]> git.pond.sub.org Git - empserver/commitdiff
Fix memory leak in air_defense() oops
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 22 Mar 2008 18:46:47 +0000 (19:46 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 26 Mar 2008 21:08:46 +0000 (22:08 +0100)
Broken in commit 9c27a771.

src/lib/subs/mission.c

index 3a2539104b4b27e549dc7f90e2b115c899cf427c..04fd878d7d349b3782484501cfd07b929c6c65ae 100644 (file)
@@ -1381,8 +1381,10 @@ air_defense(coord x, coord y, natid victim, struct emp_qelem *bomb_list,
            }
 
            path = BestAirPath(buf, air->x, air->y, x, y);
-           if (CANT_HAPPEN(!path))
+           if (CANT_HAPPEN(!path)) {
+               pln_put(&i);
                continue;
+           }
            wu(0, cn, "Flying %s mission from %s\n",
               mission_name(MI_AIR_DEFENSE), xyas(air->x, air->y, cn));
            if (air->own && (air->own != cn)) {