From d5d2af3a47753527e96cef47162eecedfb6b2b5b Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Fri, 15 Oct 2010 09:21:56 -0400 Subject: Make sdap_save_users_send handle zero users gracefully If we send a zero num_users value, we should just immediately return success, rather than starting a useless transaction --- src/providers/ldap/sdap_async_accounts.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/providers/ldap/sdap_async_accounts.c b/src/providers/ldap/sdap_async_accounts.c index 0f8ebf5a..1684af63 100644 --- a/src/providers/ldap/sdap_async_accounts.c +++ b/src/providers/ldap/sdap_async_accounts.c @@ -295,6 +295,11 @@ static int sdap_save_users(TALLOC_CTX *memctx, int ret; int i; + if (num_users == 0) { + /* Nothing to do if there are no users */ + return EOK; + } + tmpctx = talloc_new(memctx); if (!tmpctx) { return ENOMEM; -- cgit