Free the internal "always" array like we free "fds".
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
if (pos != num_always-1)
always[pos] = always[num_always-1];
num_always--;
if (pos != num_always-1)
always[pos] = always[num_always-1];
num_always--;
+
+ /* Only free if no fds left either. */
+ if (num_always == 0 && max_fds == 0) {
+ tal_free(always);
+ max_always = 0;
+ }
}
bool backend_new_always(struct io_plan *plan)
}
bool backend_new_always(struct io_plan *plan)