summaryrefslogtreecommitdiffstats
path: root/usr.bin/patch/inp.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2002-07-04 04:22:48 +0000
committerderaadt <deraadt@openbsd.org>2002-07-04 04:22:48 +0000
commit5647e46bc27dbb1e7ffa9928eb46c27533d796a4 (patch)
treee90760f75a4d2d3c09ff3a22ba92dc5aa122999b /usr.bin/patch/inp.c
parentpatch memory leaks; grendel@zeitbombe.org (diff)
downloadwireguard-openbsd-5647e46bc27dbb1e7ffa9928eb46c27533d796a4.tar.xz
wireguard-openbsd-5647e46bc27dbb1e7ffa9928eb46c27533d796a4.zip
4 unchecked mallocs; cloder@acm.org
Diffstat (limited to 'usr.bin/patch/inp.c')
-rw-r--r--usr.bin/patch/inp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/patch/inp.c b/usr.bin/patch/inp.c
index f27866571d2..a60d48aa138 100644
--- a/usr.bin/patch/inp.c
+++ b/usr.bin/patch/inp.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: inp.c,v 1.8 1999/01/03 05:33:48 millert Exp $ */
+/* $OpenBSD: inp.c,v 1.9 2002/07/04 04:22:48 deraadt Exp $ */
#ifndef lint
-static char rcsid[] = "$OpenBSD: inp.c,v 1.8 1999/01/03 05:33:48 millert Exp $";
+static char rcsid[] = "$OpenBSD: inp.c,v 1.9 2002/07/04 04:22:48 deraadt Exp $";
#endif /* not lint */
#include "EXTERN.h"
@@ -288,6 +288,8 @@ char *filename;
lines_per_buf = BUFFERSIZE / maxlen;
tireclen = maxlen;
tibuf[0] = malloc((MEM)(BUFFERSIZE + 1));
+ if (tibuf[0] == Nullch)
+ fatal1("out of memory\n");
tibuf[1] = malloc((MEM)(BUFFERSIZE + 1));
if (tibuf[1] == Nullch)
fatal1("out of memory\n");