mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 18:57:06 +01:00
db/postgres: avoid memleak.
``` "label": "db/db_postgres.c:294:char[]", "backtrace": [ "ccan/ccan/tal/tal.c:442 (tal_alloc_)", "ccan/ccan/tal/tal.c:471 (tal_alloc_arr_)", "ccan/ccan/tal/str/str.c:91 (tal_vfmt_)", "ccan/ccan/tal/str/str.c:44 (tal_fmt_)", "db/db_postgres.c:294 (db_postgres_delete_columns)", "wallet/db.c:1546 (migrate_payments_scids_as_integers)", "wallet/db.c:986 (db_migrate)", "wallet/db.c:1019 (db_setup)", "wallet/wallet.c:101 (wallet_new)", "lightningd/lightningd.c:1023 (main)", "../csu/libc-start.c:308 (__libc_start_main)" ], "parents": [ "db/utils.c:317:struct db", "lightningd/lightningd.c:107:struct lightningd" ] ``` Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
f52ff07558
commit
939a7b2b18
1 changed files with 1 additions and 1 deletions
|
@ -291,7 +291,7 @@ static bool db_postgres_delete_columns(struct db *db,
|
|||
{
|
||||
char *cmd;
|
||||
|
||||
cmd = tal_fmt(db, "ALTER TABLE %s ", tablename);
|
||||
cmd = tal_fmt(tmpctx, "ALTER TABLE %s ", tablename);
|
||||
for (size_t i = 0; i < num_cols; i++) {
|
||||
if (i != 0)
|
||||
tal_append_fmt(&cmd, ", ");
|
||||
|
|
Loading…
Add table
Reference in a new issue