summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-07-02 22:22:57 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-07-02 22:22:57 +0000
commit6ddeeb757a2e13d6f884fd09e38ff542979443a8 (patch)
tree7fac458e8411f1d8a3b0a36d4e9943fc6fc270f7
parent455d1983e8764c0949b892923117c63399cdedb5 (diff)
Check malloc() return value; Chad Loder
-rw-r--r--usr.sbin/pppd/chat/chat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/pppd/chat/chat.c b/usr.sbin/pppd/chat/chat.c
index c04dbc56686..8c3b3796798 100644
--- a/usr.sbin/pppd/chat/chat.c
+++ b/usr.sbin/pppd/chat/chat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chat.c,v 1.17 2002/05/29 19:23:34 deraadt Exp $ */
+/* $OpenBSD: chat.c,v 1.18 2002/07/02 22:22:56 millert Exp $ */
/*
* Chat -- a program for automatic session establishment (i.e. dial
@@ -83,7 +83,7 @@
#if 0
static char rcsid[] = "Id: chat.c,v 1.19 1998/03/24 23:57:48 paulus Exp $";
#else
-static char rcsid[] = "$OpenBSD: chat.c,v 1.17 2002/05/29 19:23:34 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: chat.c,v 1.18 2002/07/02 22:22:56 millert Exp $";
#endif
#endif
@@ -664,6 +664,8 @@ int sending; /* set to 1 when sending (putting) this string. */
new_length += 3; /* \r and two nuls */
ret = (char *)malloc(new_length);
+ if (ret == NULL)
+ fatal(2, "cannot allocate memory");
s1 = ret;
while (*s) {