diff options
Diffstat (limited to 'ctdb/server/eventscript.c')
-rw-r--r-- | ctdb/server/eventscript.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c index 1152319b03..10d426fba7 100644 --- a/ctdb/server/eventscript.c +++ b/ctdb/server/eventscript.c @@ -218,6 +218,7 @@ static struct ctdb_scripts_wire *ctdb_get_script_list(struct ctdb_context *ctdb, tree_item = talloc(tree, struct ctdb_script_tree_item); if (tree_item == NULL) { DEBUG(DEBUG_ERR, (__location__ " Failed to allocate new tree item\n")); + closedir(dir); talloc_free(tmp_ctx); return NULL; } @@ -230,6 +231,7 @@ static struct ctdb_scripts_wire *ctdb_get_script_list(struct ctdb_context *ctdb, tree_item->name = talloc_strdup(tree_item, de->d_name); if (tree_item->name == NULL) { DEBUG(DEBUG_ERR,(__location__ " Failed to allocate script name.\n")); + closedir(dir); talloc_free(tmp_ctx); return NULL; } @@ -880,10 +882,10 @@ int ctdb_event_script_args(struct ctdb_context *ctdb, enum ctdb_eventscript_call va_start(ap, fmt); ret = ctdb_event_script_callback_v(ctdb, ctdb, event_script_callback, &status, false, call, fmt, ap); + va_end(ap); if (ret != 0) { return ret; } - va_end(ap); status.status = -1; status.done = false; |