summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-05-25 15:10:29 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-05-25 10:41:06 -0400
commit6e588d6381bea40e8678de5650a2aab41e4a382f (patch)
tree1eaa5c0b7570199d3dca515a1cd7088976878421 /src
parent34000a9baa70a9414330dc07b1fbdb8173a7961c (diff)
downloadsssd-6e588d6381bea40e8678de5650a2aab41e4a382f.tar.gz
sssd-6e588d6381bea40e8678de5650a2aab41e4a382f.tar.bz2
sssd-6e588d6381bea40e8678de5650a2aab41e4a382f.zip
Separate return paths for success and failure in sdap_nested_group_check_cache
Diffstat (limited to 'src')
-rw-r--r--src/providers/ldap/sdap_async_accounts.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/providers/ldap/sdap_async_accounts.c b/src/providers/ldap/sdap_async_accounts.c
index d34b8849..2a85cf7c 100644
--- a/src/providers/ldap/sdap_async_accounts.c
+++ b/src/providers/ldap/sdap_async_accounts.c
@@ -3727,7 +3727,7 @@ sdap_nested_group_check_cache(TALLOC_CTX *mem_ctx,
ret = sss_filter_sanitize(tmp_ctx, dn, &member_dn);
if (ret != EOK) {
- goto done;
+ goto fail;
}
/* Check for the specified origDN in the sysdb */
@@ -3736,7 +3736,7 @@ sdap_nested_group_check_cache(TALLOC_CTX *mem_ctx,
member_dn);
if (!filter) {
ret = ENOMEM;
- goto done;
+ goto fail;
}
/* Try users first */
@@ -3744,7 +3744,7 @@ sdap_nested_group_check_cache(TALLOC_CTX *mem_ctx,
attrs, &count, &msgs);
if (ret != EOK && ret != ENOENT) {
ret = EIO;
- goto done;
+ goto fail;
} else if (ret == EOK && count > 0) {
/* We found a user with this origDN in the sysdb. Check if it is valid
*/
@@ -3754,7 +3754,7 @@ sdap_nested_group_check_cache(TALLOC_CTX *mem_ctx,
if (count != 1) {
DEBUG(1, ("More than one entry with this origDN? Skipping\n"));
ret = EIO;
- goto done;
+ goto fail;
}
user_uid = ldb_msg_find_attr_as_uint64(msgs[0], SYSDB_UIDNUM, 0);
@@ -3791,7 +3791,7 @@ sdap_nested_group_check_cache(TALLOC_CTX *mem_ctx,
filter, attrs, &count, &msgs);
if (ret != EOK && ret != ENOENT) {
ret = EIO;
- goto done;
+ goto fail;
} else if (ret == EOK && count > 0) {
/* We found a group with this origDN in the sysdb */
mtype = SYSDB_MEMBER_GROUP;
@@ -3800,7 +3800,7 @@ sdap_nested_group_check_cache(TALLOC_CTX *mem_ctx,
if (count != 1) {
DEBUG(1, ("More than one entry with this origDN? Skipping\n"));
ret = EIO;
- goto done;
+ goto fail;
}
expiration = ldb_msg_find_attr_as_uint64(msgs[0],
@@ -3826,6 +3826,10 @@ done:
}
talloc_zfree(tmp_ctx);
return ret;
+
+fail:
+ talloc_zfree(tmp_ctx);
+ return ret;
}
static void sdap_nested_group_process_deref(struct tevent_req *subreq);