1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-08 19:02:06 +03:00

[poll] avoid infinite loop in ssh_poll_ctx_free()

(cherry picked from commit eace59d3eaad413fd846d1c8b4c926285f6cd5ab)
This commit is contained in:
milo
2011-04-20 04:09:28 +02:00
parent 7ba0938846
commit 8092541603

View File

@@ -495,7 +495,12 @@ void ssh_poll_ctx_free(ssh_poll_ctx ctx) {
/* force poll object removal */
if (p->cb && p->cb(p, fd, POLLERR, p->cb_data) < 0) {
used = ctx->polls_used;
if(ctx->polls_used < used) {
used = ctx->polls_used;
} else {
/* nothing to do */
i++;
}
} else {
i++;
}