commando: add stress test, fix memleak report.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-07-21 14:40:10 +09:30
committed by neil saitug
parent 05a666e424
commit c10e385612
2 changed files with 38 additions and 1 deletions

View File

@@ -452,8 +452,11 @@ static void handle_incmd(struct node_id *peer,
incmd = find_commando(incoming_commands, peer, NULL);
/* Don't let them buffer multiple commands: discard old. */
if (incmd && incmd->id != idnum)
if (incmd && incmd->id != idnum) {
plugin_log(plugin, LOG_DBG, "New cmd from %s, replacing old",
node_id_to_hexstr(tmpctx, peer));
incmd = tal_free(incmd);
}
if (!incmd) {
incmd = tal(plugin, struct commando);
@@ -705,6 +708,7 @@ static struct command_result *json_commando(struct command *cmd,
tal_free(peer);
tal_free(method);
tal_free(cparams);
tal_free(rune);
return send_more_cmd(cmd, NULL, NULL, outgoing);
}