mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 16:44:20 +01:00
utils: remove tal_tmpctx altogether, use global.
In particular, we now only free tmpctx at the end of main(). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -77,7 +77,7 @@ REGISTER_TYPE_TO_STRING(wireaddr, fmt_wireaddr);
|
||||
* Returns false if it wasn't one of these forms. If it returns true,
|
||||
* it only overwrites *port if it was specified by <number> above.
|
||||
*/
|
||||
static bool separate_address_and_port(tal_t *ctx, const char *arg,
|
||||
static bool separate_address_and_port(const tal_t *ctx, const char *arg,
|
||||
char **addr, u16 *port)
|
||||
{
|
||||
char *portcolon;
|
||||
@@ -126,7 +126,6 @@ bool parse_wireaddr(const char *arg, struct wireaddr *addr, u16 defport,
|
||||
u16 port;
|
||||
char *ip;
|
||||
bool res;
|
||||
tal_t *tmpctx = tal_tmpctx(NULL);
|
||||
|
||||
res = false;
|
||||
port = defport;
|
||||
@@ -195,6 +194,5 @@ bool parse_wireaddr(const char *arg, struct wireaddr *addr, u16 defport,
|
||||
finish:
|
||||
if (!res && err_msg && !*err_msg)
|
||||
*err_msg = "Error parsing hostname";
|
||||
tal_free(tmpctx);
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user