common: fix missing HOME case, when we override --lightning-dir.

It fails because option.c tal_free's the old value, which must be
a tal ptr.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2019-08-26 18:15:22 +09:30
parent 2f5f364e17
commit af645b38c8

View File

@ -16,7 +16,7 @@ char *default_configdir(const tal_t *ctx)
char *path;
const char *env = getenv("HOME");
if (!env)
return ".";
return tal_strdup(ctx, ".");
path = path_join(ctx, env, ".lightning");
return path;