summaryrefslogtreecommitdiff
path: root/src/responder/autofs
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2012-10-19 11:31:08 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-03-20 13:29:29 +0100
commit6f8ae17869f4f8a1496e3f171ae6b5c11af1845c (patch)
treecc845f8e4f68de80e5aaf43d7a136049dad8a741 /src/responder/autofs
parentdfe84158c49e44f2207b94d25e61ab4f3fe38366 (diff)
downloadsssd-6f8ae17869f4f8a1496e3f171ae6b5c11af1845c.tar.gz
sssd-6f8ae17869f4f8a1496e3f171ae6b5c11af1845c.tar.bz2
sssd-6f8ae17869f4f8a1496e3f171ae6b5c11af1845c.zip
do not leak memory on failure in *_process_init()
Diffstat (limited to 'src/responder/autofs')
-rw-r--r--src/responder/autofs/autofssrv.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/responder/autofs/autofssrv.c b/src/responder/autofs/autofssrv.c
index 93deffd9..ef90207f 100644
--- a/src/responder/autofs/autofssrv.c
+++ b/src/responder/autofs/autofssrv.c
@@ -144,7 +144,7 @@ autofs_process_init(TALLOC_CTX *mem_ctx,
ret = autofs_get_config(autofs_ctx, cdb);
if (ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE, ("Cannot read autofs configuration\n"));
- return ret;
+ goto fail;
}
autofs_cmds = get_autofs_cmds();
@@ -159,7 +159,7 @@ autofs_process_init(TALLOC_CTX *mem_ctx,
&autofs_dp_interface,
&autofs_ctx->rctx);
if (ret != EOK) {
- return ret;
+ goto fail;
}
autofs_ctx->rctx->pvt_ctx = autofs_ctx;
@@ -171,7 +171,7 @@ autofs_process_init(TALLOC_CTX *mem_ctx,
if (ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE,
("Failed to set up automatic reconnection\n"));
- return ret;
+ goto fail;
}
for (iter = autofs_ctx->rctx->be_conns; iter; iter = iter->next) {
@@ -185,11 +185,16 @@ autofs_process_init(TALLOC_CTX *mem_ctx,
if (hret != HASH_SUCCESS) {
DEBUG(SSSDBG_CRIT_FAILURE,
("Unable to initialize automount maps hash table\n"));
- return EIO;
+ ret = EIO;
+ goto fail;
}
DEBUG(SSSDBG_TRACE_FUNC, ("autofs Initialization complete\n"));
return EOK;
+
+fail:
+ talloc_free(autofs_ctx);
+ return ret;
}
int main(int argc, const char *argv[])