lightningd: trivial cleanup: use tmpctx.

No need to explicitly free this var, we can use tmpctx.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-04-19 14:14:22 +09:30
parent 901342b50d
commit 86c29b6acc

View file

@ -1014,7 +1014,7 @@ void channel_internal_error(struct channel *channel, const char *fmt, ...)
char *why;
va_start(ap, fmt);
why = tal_vfmt(channel, fmt, ap);
why = tal_vfmt(tmpctx, fmt, ap);
va_end(ap);
log_broken(channel->log, "Internal error %s: %s",
@ -1026,7 +1026,6 @@ void channel_internal_error(struct channel *channel, const char *fmt, ...)
if (channel_state_uncommitted(channel->state)) {
channel_set_owner(channel, NULL);
delete_channel(channel);
tal_free(why);
return;
}
@ -1036,7 +1035,6 @@ void channel_internal_error(struct channel *channel, const char *fmt, ...)
REASON_LOCAL, "Internal error: %s", why);
else
channel_fail_permanent(channel, REASON_LOCAL, "Internal error");
tal_free(why);
}
void channel_set_billboard(struct channel *channel, bool perm, const char *str)