From f2428cadd8e724ef306c4cc08f191585aa07e9dc Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Tue, 5 Feb 2013 13:08:55 +1100 Subject: ctdbd: Remove debug_hung_script_ctx The only allocation against this context is by ctdb_fork_with_logging(). This memory is freed by ctdb_log_handler() anyway. There should be no memory leak. Signed-off-by: Martin Schwenke (This used to be ctdb commit 501461cc3e132d4adee9e91b5d4513a26bae2846) --- ctdb/include/ctdb_private.h | 1 - ctdb/server/eventscript.c | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'ctdb') diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index cd0feaaf94..26ddc34afe 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -539,7 +539,6 @@ struct ctdb_context { const char *public_addresses_file; struct trbt_tree *child_processes; - TALLOC_CTX *debug_hung_script_ctx; /* Used for locking record/db/alldb */ int lock_num_current; diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c index 762f9506fa..20f16fa156 100644 --- a/ctdb/server/eventscript.c +++ b/ctdb/server/eventscript.c @@ -528,9 +528,7 @@ static void ctdb_run_debug_hung_script(struct ctdb_context *ctdb, struct ctdb_ev cmd, timeval_elapsed(¤t->start), state->child)); talloc_free(cmd); - talloc_free(ctdb->debug_hung_script_ctx); - ctdb->debug_hung_script_ctx = talloc_new(ctdb); - if (!ctdb_fork_with_logging(ctdb->debug_hung_script_ctx, ctdb, "Hung script", NULL, NULL, &pid)) { + if (!ctdb_fork_with_logging(ctdb, ctdb, "Hung script", NULL, NULL, &pid)) { DEBUG(DEBUG_ERR,("Failed to fork a child process with logging to track hung event script\n")); ctdb_kill(state->ctdb, state->child, SIGTERM); return; -- cgit