[BACK]Return to channels.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/channels.c between version 1.241 and 1.242

version 1.241, 2006/03/20 18:48:34 version 1.242, 2006/03/25 00:05:41
Line 248 
Line 248 
         /* Do initial allocation if this is the first call. */          /* Do initial allocation if this is the first call. */
         if (channels_alloc == 0) {          if (channels_alloc == 0) {
                 channels_alloc = 10;                  channels_alloc = 10;
                 channels = xmalloc(channels_alloc * sizeof(Channel *));                  channels = xcalloc(channels_alloc, sizeof(Channel *));
                 for (i = 0; i < channels_alloc; i++)                  for (i = 0; i < channels_alloc; i++)
                         channels[i] = NULL;                          channels[i] = NULL;
         }          }
Line 273 
Line 273 
                         channels[i] = NULL;                          channels[i] = NULL;
         }          }
         /* Initialize and return new channel. */          /* Initialize and return new channel. */
         c = channels[found] = xmalloc(sizeof(Channel));          c = channels[found] = xcalloc(1, sizeof(Channel));
         memset(c, 0, sizeof(Channel));  
         buffer_init(&c->input);          buffer_init(&c->input);
         buffer_init(&c->output);          buffer_init(&c->output);
         buffer_init(&c->extended);          buffer_init(&c->extended);
Line 2808 
Line 2807 
         }          }
   
         /* Allocate a channel for each socket. */          /* Allocate a channel for each socket. */
         *chanids = xmalloc(sizeof(**chanids) * (num_socks + 1));          *chanids = xcalloc(num_socks + 1, sizeof(**chanids));
         for (n = 0; n < num_socks; n++) {          for (n = 0; n < num_socks; n++) {
                 sock = socks[n];                  sock = socks[n];
                 nc = channel_new("x11 listener",                  nc = channel_new("x11 listener",

Legend:
Removed from v.1.241  
changed lines
  Added in v.1.242