bkpr: duplicate the name, dont steal it

This commit is contained in:
niftynei 2022-07-19 17:04:39 +09:30 committed by Rusty Russell
parent 0617690981
commit 97204d6e0a

View file

@ -1,17 +1,18 @@
#include "config.h"
#include <ccan/str/str.h>
#include <ccan/tal/str/str.h>
#include <common/coin_mvt.h>
#include <common/node_id.h>
#include <plugins/bkpr/account.h>
struct account *new_account(const tal_t *ctx,
const char *name STEALS,
const char *name,
struct node_id *peer_id)
{
struct account *a = tal(ctx, struct account);
a->name = tal_steal(a, name);
a->name = tal_strdup(a, name);
a->peer_id = peer_id;
a->is_wallet = streq(a->name, WALLET);
a->we_opened = false;