lightningd, libplugins: allocate opt strings from tmpctx, not NULL.

Previously, if these failed we always exited; once we have dymamic
configs this would be a (tiny) memory leak, so use tmpctx.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-06-06 10:08:47 +09:30
parent aca893f1eb
commit ecc030f12d
6 changed files with 52 additions and 52 deletions

View File

@@ -30,7 +30,7 @@ char *funding_option(const char *arg, enum funder_opt *opt)
else if (streq(arg, "fixed"))
*opt = FIXED;
else
return tal_fmt(NULL, "'%s' is not a valid option"
return tal_fmt(tmpctx, "'%s' is not a valid option"
" (match, available, fixed)",
arg);
return NULL;