summaryrefslogtreecommitdiffstats
path: root/channels.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-09-17 07:31:14 +1000
committerDamien Miller <djm@mindrot.org>2003-09-17 07:31:14 +1000
commit5efcecc26525b58f699997697e6114fd83708733 (patch)
tree6b160851a0cda23287072125a1d030fa7d57b900 /channels.c
parentf2728099baa0fe4e6f1a8bfa321aefbf412f6543 (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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/channels.c b/channels.c
index 65a6a7f0..3d75c8f2 100644
--- a/channels.c
+++ b/channels.c
@@ -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;
}