diff options
author | Damien Miller <djm@mindrot.org> | 2003-09-17 07:31:14 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2003-09-17 07:31:14 +1000 |
commit | 5efcecc26525b58f699997697e6114fd83708733 (patch) | |
tree | 6b160851a0cda23287072125a1d030fa7d57b900 /channels.c | |
parent | f2728099baa0fe4e6f1a8bfa321aefbf412f6543 (diff) |
- (djm) OpenBSD Sync
- markus@cvs.openbsd.org 2003/09/16 21:02:40
[buffer.c channels.c version.h]
more malloc/fatal fixes; ok millert/deraadt; ghudson at MIT.EDU
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: channels.c,v 1.194 2003/08/29 10:04:36 markus Exp $"); +RCSID("$OpenBSD: channels.c,v 1.195 2003/09/16 21:02:40 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -229,12 +229,13 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd, if (found == -1) { /* There are no free slots. Take last+1 slot and expand the array. */ found = channels_alloc; - channels_alloc += 10; if (channels_alloc > 10000) fatal("channel_new: internal error: channels_alloc %d " "too big.", channels_alloc); + channels = xrealloc(channels, + (channels_alloc + 10) * sizeof(Channel *)); + channels_alloc += 10; debug2("channel: expanding %d", channels_alloc); - channels = xrealloc(channels, channels_alloc * sizeof(Channel *)); for (i = found; i < channels_alloc; i++) channels[i] = NULL; } |