diff --git a/ccan/ccan/tal/tal.c b/ccan/ccan/tal/tal.c index 061fc2907aff..e0ca30d72c32 100644 --- a/ccan/ccan/tal/tal.c +++ b/ccan/ccan/tal/tal.c @@ -777,7 +777,7 @@ void *tal_dup_(const tal_t *ctx, const void *p, size_t size, (void)taken(p); return NULL; } - + if (!adjust_size(&nbytes, n)) { if (taken(p)) tal_free(p); diff --git a/plugins/bkpr/incomestmt.c b/plugins/bkpr/incomestmt.c index f20880249778..ff65fec5544b 100644 --- a/plugins/bkpr/incomestmt.c +++ b/plugins/bkpr/incomestmt.c @@ -115,13 +115,13 @@ static char *csv_safe_str(const tal_t *ctx, char *input TAKES) char *dupe; /* Update the double-quotes in place */ - dupe = tal_strdup(ctx, input); + dupe = tal_strdup(tmpctx, input); for (size_t i = 0; dupe[i] != '\0'; i++) { if (dupe[i] == '"') dupe[i] = '\''; } - esc = json_escape(ctx, dupe); + esc = json_escape(tmpctx, take(dupe)); return tal_fmt(ctx, "\"%s\"", esc->s); }