1
0
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:
Andreas Schneider
2012-10-05 10:46:08 +02:00
parent 213321d706
commit 332f1a2a51

View File

@@ -3046,10 +3046,14 @@ int ssh_channel_select(ssh_channel *readchans, ssh_channel *writechans,
break;
}
/* Add all channels' sessions right into an event object */
if (!event){
if (event == NULL) {
event = ssh_event_new();
if(!event){
return SSH_ERROR;
if (event == NULL) {
SAFE_FREE(rchans);
SAFE_FREE(wchans);
SAFE_FREE(echans);
return SSH_ERROR;
}
for (i = 0; readchans[i] != NULL; i++) {
ssh_poll_get_default_ctx(readchans[i]->session);