mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-08 19:02:06 +03:00
channels: Fix a memory leak in ssh_channel_select().
This commit is contained in:
@@ -3046,10 +3046,14 @@ int ssh_channel_select(ssh_channel *readchans, ssh_channel *writechans,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* Add all channels' sessions right into an event object */
|
/* Add all channels' sessions right into an event object */
|
||||||
if (!event){
|
if (event == NULL) {
|
||||||
event = ssh_event_new();
|
event = ssh_event_new();
|
||||||
if(!event){
|
if (event == NULL) {
|
||||||
return SSH_ERROR;
|
SAFE_FREE(rchans);
|
||||||
|
SAFE_FREE(wchans);
|
||||||
|
SAFE_FREE(echans);
|
||||||
|
|
||||||
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
for (i = 0; readchans[i] != NULL; i++) {
|
for (i = 0; readchans[i] != NULL; i++) {
|
||||||
ssh_poll_get_default_ctx(readchans[i]->session);
|
ssh_poll_get_default_ctx(readchans[i]->session);
|
||||||
|
Reference in New Issue
Block a user