diff options
author | Damien Miller <djm@mindrot.org> | 2003-09-17 07:34:12 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2003-09-17 07:34:12 +1000 |
commit | 92dc672aac7e659192a8eb0ee401e81ce63e48b2 (patch) | |
tree | 9accc49bef475c9dfd299e28dad33cb53c451b5d /channels.c | |
parent | 9d1471514608023cda6456f5a2e875cc5e4b9e77 (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
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" |
42 | RCSID("$OpenBSD: channels.c,v 1.194 2003/08/29 10:04:36 markus Exp $"); | 42 | RCSID("$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 | } |