Avoid segfault on CLI command "dev-memleak" when $LIGHTNINGD_DEV_MEMLEAK is not set
This commit is contained in:
parent
44836ef509
commit
447afa923d
|
@ -144,9 +144,11 @@ static void json_memleak(struct command *cmd,
|
|||
{
|
||||
struct json_result *response = new_json_result(cmd);
|
||||
|
||||
if (!getenv("LIGHTNINGD_DEV_MEMLEAK"))
|
||||
if (!getenv("LIGHTNINGD_DEV_MEMLEAK")) {
|
||||
command_fail(cmd,
|
||||
"Leak detection needs $LIGHTNINGD_DEV_MEMLEAK");
|
||||
return;
|
||||
}
|
||||
|
||||
json_object_start(response, NULL);
|
||||
scan_mem(cmd, response, cmd->ld);
|
||||
|
|
Loading…
Reference in New Issue