summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authord <d@openbsd.org>1999-08-30 23:30:08 +0000
committerd <d@openbsd.org>1999-08-30 23:30:08 +0000
commit70a075a5133382340a5ee4f163c8fcb7ed107f4a (patch)
tree3c83cb0e5fbe092eb3c3e48d24c715d4c8892518
parentadd semicolon to pacify gcc -Wall (diff)
downloadwireguard-openbsd-70a075a5133382340a5ee4f163c8fcb7ed107f4a.tar.xz
wireguard-openbsd-70a075a5133382340a5ee4f163c8fcb7ed107f4a.zip
check malloc return
-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;