channels: Use calloc() in ssh_channel_new()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Этот коммит содержится в:
родитель
9ac6ac6c26
Коммит
ca464ca2ba
@ -84,12 +84,11 @@ ssh_channel ssh_channel_new(ssh_session session)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
channel = malloc(sizeof(struct ssh_channel_struct));
|
channel = calloc(1, sizeof(struct ssh_channel_struct));
|
||||||
if (channel == NULL) {
|
if (channel == NULL) {
|
||||||
ssh_set_error_oom(session);
|
ssh_set_error_oom(session);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
memset(channel,0,sizeof(struct ssh_channel_struct));
|
|
||||||
|
|
||||||
channel->stdout_buffer = ssh_buffer_new();
|
channel->stdout_buffer = ssh_buffer_new();
|
||||||
if (channel->stdout_buffer == NULL) {
|
if (channel->stdout_buffer == NULL) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user