diff options
-rw-r--r-- | src/providers/ldap/sdap_async_nested_groups.c | 5 |
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; } |