summaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/chat.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>2004-10-11 09:45:58 +0000
committerBrian Somers <brian@FreeBSD.org>2004-10-11 09:45:58 +0000
commit5d604c11618e342901aac84755c4379713adbad7 (patch)
tree3639860937ba7fdc883bbc6b4968e1c1e97bbc2b /usr.sbin/ppp/chat.c
parentcc34aa2094d711c91078c00554f4438a6e1e6aee (diff)
downloadsrc-test2-5d604c11618e342901aac84755c4379713adbad7.tar.gz
src-test2-5d604c11618e342901aac84755c4379713adbad7.zip
Notes
Diffstat (limited to 'usr.sbin/ppp/chat.c')
-rw-r--r--usr.sbin/ppp/chat.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/ppp/chat.c b/usr.sbin/ppp/chat.c
index 7e2748719274..04b267929780 100644
--- a/usr.sbin/ppp/chat.c
+++ b/usr.sbin/ppp/chat.c
@@ -243,9 +243,10 @@ chat_UpdateSet(struct fdescriptor *d, fd_set *r, fd_set *w, fd_set *e, int *n)
break;
}
c->abort.string[i].len = len;
- c->abort.string[i].data = (char *)malloc(len+1);
- memcpy(c->abort.string[i].data, c->exp+2, len+1);
- c->abort.num++;
+ if ((c->abort.string[i].data = (char *)malloc(len+1)) != NULL) {
+ memcpy(c->abort.string[i].data, c->exp+2, len+1);
+ c->abort.num++;
+ }
} else
log_Printf(LogERROR, "chat_UpdateSet: too many abort strings\n");
gotabort = 0;