summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-10-16 10:55:20 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-10-16 14:27:23 -0400
commit50c3aad0676fb66b6204537c841b2c9d71835537 (patch)
tree54d1929bce460404150add79e70da7a0ee4b39b0 /server
parent9a554bc4e94c99ed7969468a5c345608a5777af0 (diff)
downloadsssd-50c3aad0676fb66b6204537c841b2c9d71835537.tar.gz
sssd-50c3aad0676fb66b6204537c841b2c9d71835537.tar.bz2
sssd-50c3aad0676fb66b6204537c841b2c9d71835537.zip
Fix segfault when using SSS tools with no local provider
There was a double-free here. I removed the free()s within setup_db, because upon returning to sss_init_tools(), if ret != EOK, the context is freed as well.
Diffstat (limited to 'server')
-rw-r--r--server/tools/tools_util.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/server/tools/tools_util.c b/server/tools/tools_util.c
index bc6b76f4..17cc3aa7 100644
--- a/server/tools/tools_util.c
+++ b/server/tools/tools_util.c
@@ -39,13 +39,11 @@ static int setup_db(struct tools_ctx *ctx)
ctx->ev = tevent_context_init(ctx);
if (ctx->ev == NULL) {
DEBUG(1, ("Could not create event context\n"));
- talloc_free(ctx);
return EIO;
}
confdb_path = talloc_asprintf(ctx, "%s/%s", DB_PATH, CONFDB_FILE);
if (confdb_path == NULL) {
- talloc_free(ctx);
return ENOMEM;
}
@@ -53,14 +51,12 @@ static int setup_db(struct tools_ctx *ctx)
ret = confdb_init(ctx, &ctx->confdb, confdb_path);
if (ret != EOK) {
DEBUG(1, ("Could not initialize connection to the confdb\n"));
- talloc_free(ctx);
return ret;
}
ret = confdb_get_domain(ctx->confdb, "local", &ctx->local);
if (ret != EOK) {
DEBUG(1, ("Could not get 'local' domain\n"));
- talloc_free(ctx);
return ret;
}
@@ -68,7 +64,6 @@ static int setup_db(struct tools_ctx *ctx)
ret = sysdb_domain_init(ctx, ctx->ev, ctx->local, DB_PATH, &ctx->sysdb);
if (ret != EOK) {
DEBUG(1, ("Could not initialize connection to the sysdb\n"));
- talloc_free(ctx);
return ret;
}