summaryrefslogtreecommitdiff
path: root/games/hunt
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1999-08-30 23:30:09 +0000
committerDavid Leonard <d@cvs.openbsd.org>1999-08-30 23:30:09 +0000
commit932e908099d41cc7e7f675cbc63fc509319d7331 (patch)
tree8884e640ff8a8fec28ee494556f3968a6ac9323f /games/hunt
parent1d858896d3b6366e69f8d1a1d694b3779b4489f5 (diff)
check malloc return
Diffstat (limited to 'games/hunt')
-rw-r--r--games/hunt/huntd/expl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/games/hunt/huntd/expl.c b/games/hunt/huntd/expl.c
index 53b6669fc08..f40ce908617 100644
--- a/games/hunt/huntd/expl.c
+++ b/games/hunt/huntd/expl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: expl.c,v 1.4 1999/02/01 06:53:56 d Exp $ */
+/* $OpenBSD: expl.c,v 1.5 1999/08/30 23:30:08 d Exp $ */
/* $NetBSD: expl.c,v 1.2 1997/10/10 16:33:18 lukem Exp $ */
/*
* Hunt
@@ -34,6 +34,10 @@ showexpl(y, x, type)
if (x < 0 || x >= WIDTH)
return;
ep = (EXPL *) malloc(sizeof (EXPL)); /* NOSTRICT */
+ if (ep == NULL) {
+ log(LOG_ERR, "malloc");
+ return;
+ }
ep->e_y = y;
ep->e_x = x;
ep->e_char = type;