diff options
author | christos <christos@NetBSD.org> | 2006-03-19 00:37:15 +0000 |
---|---|---|
committer | christos <christos@NetBSD.org> | 2006-03-19 00:37:15 +0000 |
commit | e9c5e5ae624072d97150a99f5caaa701145f6cd7 (patch) | |
tree | ab0ff41e31aa65ee82d830737e42078edfa6cede /larn | |
parent | 090a8a4772320cdab74b83318589416ad190514d (diff) | |
download | bsdgames-darwin-e9c5e5ae624072d97150a99f5caaa701145f6cd7.tar.gz bsdgames-darwin-e9c5e5ae624072d97150a99f5caaa701145f6cd7.tar.zst bsdgames-darwin-e9c5e5ae624072d97150a99f5caaa701145f6cd7.zip |
Coverity CID 2073: Fix memory leak.
Diffstat (limited to 'larn')
-rw-r--r-- | larn/monster.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/larn/monster.c b/larn/monster.c index eb80a9e8..972b67a9 100644 --- a/larn/monster.c +++ b/larn/monster.c @@ -1,4 +1,4 @@ -/* $NetBSD: monster.c,v 1.9 2006/03/19 00:32:18 christos Exp $ */ +/* $NetBSD: monster.c,v 1.10 2006/03/19 00:37:15 christos Exp $ */ /* * monster.c Larn is copyrighted 1986 by Noah Morgan. @@ -100,7 +100,7 @@ */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: monster.c,v 1.9 2006/03/19 00:32:18 christos Exp $"); +__RCSID("$NetBSD: monster.c,v 1.10 2006/03/19 00:37:15 christos Exp $"); #endif /* not lint */ #include <string.h> @@ -1768,6 +1768,7 @@ newsphere(x, y, dir, life) lprintf("\nThe %s dispels the sphere!", monster[m].name); beep(); rmsphere(x, y); /* remove any spheres that are here */ + free(sp); return (c[SPHCAST]); } if (m == DISENCHANTRESS) { /* disenchantress cancels spheres */ @@ -1776,6 +1777,7 @@ newsphere(x, y, dir, life) beep(); boom: sphboom(x, y); /* blow up stuff around sphere */ rmsphere(x, y); /* remove any spheres that are here */ + free(sp); return (c[SPHCAST]); } if (c[CANCELLATION]) { /* cancellation cancels spheres */ |