summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap
diff options
context:
space:
mode:
authorPavel Reichl <preichl@redhat.com>2014-06-26 18:22:40 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-06-27 17:57:26 +0200
commit759fd29a597533a3f5489246c0d2b658d8bee417 (patch)
tree5a5a7498e031c0e9434b3d9567d7571e30066a01 /src/providers/ldap
parent0d47aef7577f8cf651255cf59df87b3847dbe1ad (diff)
downloadsssd-759fd29a597533a3f5489246c0d2b658d8bee417.tar.gz
sssd-759fd29a597533a3f5489246c0d2b658d8bee417.tar.xz
sssd-759fd29a597533a3f5489246c0d2b658d8bee417.zip
LDAP: group_split_members returns incorrectly ENOMEM
Don't fail if num_missing is 0. Resolves: https://fedorahosted.org/sssd/ticket/2369 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/providers/ldap')
-rw-r--r--src/providers/ldap/sdap_async_nested_groups.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap_async_nested_groups.c b/src/providers/ldap/sdap_async_nested_groups.c
index b17946fc3..bc3250248 100644
--- a/src/providers/ldap/sdap_async_nested_groups.c
+++ b/src/providers/ldap/sdap_async_nested_groups.c
@@ -589,7 +589,10 @@ sdap_nested_group_split_members(TALLOC_CTX *mem_ctx,
missing = talloc_realloc(mem_ctx, missing,
struct sdap_nested_group_member, num_missing);
- if (missing == NULL) {
+ /* talloc_realloc behaves as talloc_free if 3rd parameter (count) is 0,
+ * so it's OK to return NULL then
+ */
+ if (missing == NULL && num_missing > 0) {
ret = ENOMEM;
goto done;
}