From 581ee2e4c32a1ddb77f4fccb6a5ade610998d47e Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Wed, 23 Apr 2014 11:44:20 +1000 Subject: [PATCH] ctdb-tools/ctdb: Unlock records before closing tdb database Now freeing ctdb_db context will close the tdb database. So make sure all the locks are released (by freeing record handles or memory context from which record handles are allocated) before freeing ctdb_db context. Signed-off-by: Amitay Isaacs Reviewed-by: Michael Adam --- ctdb/tools/ctdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 4afb3e7af7b..624c61c2f80 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -3842,8 +3842,8 @@ static int control_readkey(struct ctdb_context *ctdb, int argc, const char **arg printf("Data: size:%d ptr:[%.*s]\n", (int)data.dsize, (int)data.dsize, data.dptr); - talloc_free(ctdb_db); talloc_free(tmp_ctx); + talloc_free(ctdb_db); return 0; } @@ -3892,8 +3892,8 @@ static int control_writekey(struct ctdb_context *ctdb, int argc, const char **ar } talloc_free(h); - talloc_free(ctdb_db); talloc_free(tmp_ctx); + talloc_free(ctdb_db); return 0; } -- 2.11.4.GIT