wallet: Call db_stmt_free from the db_stmt destructor automatically

This is much more in line with the rest of our memory management.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2019-08-03 14:48:38 +02:00
committed by Rusty Russell
parent 093f5bfbec
commit e65e4fcf4b
3 changed files with 15 additions and 10 deletions

View File

@@ -128,7 +128,7 @@ static void db_sqlite3_stmt_free(struct db_stmt *stmt)
{
if (stmt->inner_stmt)
sqlite3_finalize(stmt->inner_stmt);
tal_free(stmt);
stmt->inner_stmt = NULL;
}
struct db_config db_sqlite3_config = {