summaryrefslogtreecommitdiffstats
path: root/hack
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2006-05-13 22:43:02 +0000
committerchristos <christos@NetBSD.org>2006-05-13 22:43:02 +0000
commitc36e6ebf618a0458499829024f8695f5c9fdb56c (patch)
treeb7e0e270156b450df4ebd2f94fed04a53c1d12b8 /hack
parent89548feb7a1fe93029a8a346ed4dcc447b51102b (diff)
downloadbsdgames-darwin-c36e6ebf618a0458499829024f8695f5c9fdb56c.tar.gz
bsdgames-darwin-c36e6ebf618a0458499829024f8695f5c9fdb56c.tar.zst
bsdgames-darwin-c36e6ebf618a0458499829024f8695f5c9fdb56c.zip
Coverity CID 3383: Fix memory leak.
Diffstat (limited to 'hack')
-rw-r--r--hack/hack.worm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hack/hack.worm.c b/hack/hack.worm.c
index 349c1c7f..8da7e78b 100644
--- a/hack/hack.worm.c
+++ b/hack/hack.worm.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.worm.c,v 1.5 2003/04/02 18:36:41 jsm Exp $ */
+/* $NetBSD: hack.worm.c,v 1.6 2006/05/13 22:43:02 christos Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.worm.c,v 1.5 2003/04/02 18:36:41 jsm Exp $");
+__RCSID("$NetBSD: hack.worm.c,v 1.6 2006/05/13 22:43:02 christos Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -269,6 +269,7 @@ cutworm(mtmp, x, y, weptyp)
} else {
pline("You cut off part of the worm's tail.");
remseg(wtmp);
+ monfree(mtmp2);
}
mtmp->mhp /= 2;
return;