mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
bcli: allocate temp string off of short-lived cmd
`cmd` gets cleaned up almost immediately, and is the right scope for a temporary string allocation
This commit is contained in:
committed by
Christian Decker
parent
f9a2489424
commit
08c8581461
@@ -601,7 +601,7 @@ static struct command_result *process_sendrawtransaction(struct bitcoin_cli *bcl
|
|||||||
response = jsonrpc_stream_success(bcli->cmd);
|
response = jsonrpc_stream_success(bcli->cmd);
|
||||||
json_add_bool(response, "success", *bcli->exitstatus == 0);
|
json_add_bool(response, "success", *bcli->exitstatus == 0);
|
||||||
json_add_string(response, "errmsg",
|
json_add_string(response, "errmsg",
|
||||||
bcli->exitstatus ? tal_strndup(bcli, bcli->output,
|
bcli->exitstatus ? tal_strndup(bcli->cmd, bcli->output,
|
||||||
bcli->output_bytes-1) : "");
|
bcli->output_bytes-1) : "");
|
||||||
|
|
||||||
return command_finished(bcli->cmd, response);
|
return command_finished(bcli->cmd, response);
|
||||||
|
|||||||
Reference in New Issue
Block a user