summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
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 65a6a7f00..3d75c8f2b 100644
--- a/channels.c
+++ b/channels.c
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: channels.c,v 1.194 2003/08/29 10:04:36 markus Exp $"); 42RCSID("$OpenBSD: channels.c,v 1.195 2003/09/16 21:02:40 markus Exp $");
43 43
44#include "ssh.h" 44#include "ssh.h"
45#include "ssh1.h" 45#include "ssh1.h"
@@ -229,12 +229,13 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
229 if (found == -1) { 229 if (found == -1) {
230 /* There are no free slots. Take last+1 slot and expand the array. */ 230 /* There are no free slots. Take last+1 slot and expand the array. */
231 found = channels_alloc; 231 found = channels_alloc;
232 channels_alloc += 10;
233 if (channels_alloc > 10000) 232 if (channels_alloc > 10000)
234 fatal("channel_new: internal error: channels_alloc %d " 233 fatal("channel_new: internal error: channels_alloc %d "
235 "too big.", channels_alloc); 234 "too big.", channels_alloc);
235 channels = xrealloc(channels,
236 (channels_alloc + 10) * sizeof(Channel *));
237 channels_alloc += 10;
236 debug2("channel: expanding %d", channels_alloc); 238 debug2("channel: expanding %d", channels_alloc);
237 channels = xrealloc(channels, channels_alloc * sizeof(Channel *));
238 for (i = found; i < channels_alloc; i++) 239 for (i = found; i < channels_alloc; i++)
239 channels[i] = NULL; 240 channels[i] = NULL;
240 } 241 }