diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-07-04 04:22:49 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-07-04 04:22:49 +0000 |
commit | 14df51898fb77d30235fa80d84b66f49925f4bb2 (patch) | |
tree | 1d08b18caa73b563017a1094e989d68f3aaa0a85 /usr.bin/patch/inp.c | |
parent | e8072b366f5ecdf3ab9a030a80664186605c4911 (diff) |
4 unchecked mallocs; cloder@acm.org
Diffstat (limited to 'usr.bin/patch/inp.c')
-rw-r--r-- | usr.bin/patch/inp.c | 6 |
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"); |