summaryrefslogtreecommitdiffstats
path: root/ctdb/server/eventscript.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2011-08-10 17:53:56 +0200
committerAmitay Isaacs <amitay@gmail.com>2013-07-11 15:16:55 +1000
commit157f1cfefd898aa7fb3dc67796565e4d5ad3d37c (patch)
tree69c2e111284d2850afd15b495ed9c2c403d90509 /ctdb/server/eventscript.c
parentd039f799ac426c903289800edc8febabe5bec49d (diff)
downloadsamba-157f1cfefd898aa7fb3dc67796565e4d5ad3d37c.tar.gz
samba-157f1cfefd898aa7fb3dc67796565e4d5ad3d37c.tar.xz
samba-157f1cfefd898aa7fb3dc67796565e4d5ad3d37c.zip
Fixes for various issues found by Coverity
Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 05bfdbbd0d4abdfbcf28e3930086723508b35952)
Diffstat (limited to 'ctdb/server/eventscript.c')
-rw-r--r--ctdb/server/eventscript.c4
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;