diff --git a/lightningd/subd.c b/lightningd/subd.c index 80b5aa00cbd2..b4bd99de3f0f 100644 --- a/lightningd/subd.c +++ b/lightningd/subd.c @@ -711,7 +711,7 @@ static struct subd *new_subd(const tal_t *ctx, const char *happenings), va_list *ap) { - struct subd *sd = tal(ctx, struct subd); + struct subd *sd = tal(NULL, struct subd); int msg_fd; const char *debug_subd = NULL; const char *shortname; @@ -770,7 +770,7 @@ static struct subd *new_subd(const tal_t *ctx, sd->node_id = tal_dup_or_null(sd, struct node_id, node_id); /* conn actually owns daemon: we die when it does. */ - sd->conn = io_new_conn(ld, msg_fd, msg_setup, sd); + sd->conn = io_new_conn(ctx, msg_fd, msg_setup, sd); tal_steal(sd->conn, sd); log_peer_debug(sd->log, node_id, "pid %u, msgfd %i", sd->pid, msg_fd);