Commit 2b3517d4 authored by Rusty Russell's avatar Rusty Russell

io: fix another leak path for always array.

Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent b089d462
...@@ -91,6 +91,10 @@ static void del_fd(struct fd *fd) ...@@ -91,6 +91,10 @@ static void del_fd(struct fd *fd)
pollfds = tal_free(pollfds); pollfds = tal_free(pollfds);
fds = NULL; fds = NULL;
max_fds = 0; max_fds = 0;
if (num_always == 0) {
always = tal_free(always);
max_always = 0;
}
} }
num_fds--; num_fds--;
fd->backend_info = -1; fd->backend_info = -1;
...@@ -140,7 +144,7 @@ static void remove_from_always(const struct io_plan *plan) ...@@ -140,7 +144,7 @@ static void remove_from_always(const struct io_plan *plan)
/* Only free if no fds left either. */ /* Only free if no fds left either. */
if (num_always == 0 && max_fds == 0) { if (num_always == 0 && max_fds == 0) {
tal_free(always); always = tal_free(always);
max_always = 0; max_always = 0;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment