From e9c5e5ae624072d97150a99f5caaa701145f6cd7 Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 19 Mar 2006 00:37:15 +0000 Subject: Coverity CID 2073: Fix memory leak. --- larn/monster.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'larn') 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 #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 @@ -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 */ -- cgit v1.2.3-56-ge451