dualopend: fix minor memleak report.

It would be freed eventually, but this is clearer.

```
 MEMLEAK: 0x56402bbfb6a8
   label=openingd/dualopend.c:362:char[]
   backtrace:
     ccan/ccan/tal/tal.c:477 (tal_alloc_)
     ccan/ccan/tal/tal.c:506 (tal_alloc_arr_)
     ccan/ccan/tal/tal.c:850 (tal_dup_)
     openingd/dualopend.c:362 (open_abort)
     openingd/dualopend.c:3411 (rbf_wrap_up)
     openingd/dualopend.c:3787 (rbf_remote_start)
     openingd/dualopend.c:4135 (handle_peer_in)
     openingd/dualopend.c:4421 (main)
   parents:
     openingd/dualopend.c:349:char[]
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-05-23 20:02:25 +09:30
parent 1af9b9d0a8
commit 6a86e80a30

View File

@ -359,7 +359,7 @@ static void open_abort(struct state *state,
* status. */
peer_billboard(true, errmsg);
msg = towire_tx_abort(NULL, &state->channel_id,
(u8 *)tal_dup_arr(errmsg, char, errmsg,
(u8 *)tal_dup_arr(tmpctx, char, errmsg,
strlen(errmsg), 0));
peer_write(state->pps, take(msg));