From 86c29b6accef2173e5c09536a9e6bcbe18558d7d Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 19 Apr 2024 14:14:22 +0930 Subject: [PATCH] lightningd: trivial cleanup: use tmpctx. No need to explicitly free this var, we can use tmpctx. Signed-off-by: Rusty Russell --- lightningd/channel.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lightningd/channel.c b/lightningd/channel.c index 711546a2b..afbfc41bd 100644 --- a/lightningd/channel.c +++ b/lightningd/channel.c @@ -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)