From 19b9f9fbaea7bc446e77426f1f1b7f2bb2c14d77 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 26 Nov 2001 01:20:57 +0000 Subject: Removed bogus SAFE_FREE() call of talloced return data from winbindd_lookup_usergroups() (This used to be commit dd2048c418da7a08bc71305491953731fc427f5a) --- source3/nsswitch/winbindd_util.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'source3/nsswitch/winbindd_util.c') diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index 75ed3a9efe..c603bac054 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -403,7 +403,6 @@ BOOL winbindd_lookup_sid_by_name(char *name, DOM_SID *sid, enum SID_NAME_USE *ty return False; /* Negative cache hit. */ return True; } - /* Lookup name */ if (!(mem_ctx = talloc_init())) @@ -431,7 +430,7 @@ BOOL winbindd_lookup_sid_by_name(char *name, DOM_SID *sid, enum SID_NAME_USE *ty *type = types[0]; /* Store the forward and reverse map of this lookup in the cache. */ - store_sid_by_name_in_cache(name, &sids[0], types[0]); + store_sid_by_name_in_cache(name, &sids[0], types[0]); store_name_by_sid_in_cache(&sids[0], name, types[0]); } else { /* JRA. Here's where we add the -ve cache store with a name type of SID_NAME_USE_NONE. */ @@ -587,19 +586,16 @@ BOOL winbindd_lookup_userinfo(struct winbindd_domain *domain, /* Lookup groups a user is a member of. I wish Unix had a call like this! */ BOOL winbindd_lookup_usergroups(struct winbindd_domain *domain, + TALLOC_CTX *mem_ctx, uint32 user_rid, uint32 *num_groups, DOM_GID **user_groups) { - TALLOC_CTX *mem_ctx; CLI_POLICY_HND *hnd; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; POLICY_HND dom_pol, user_pol; uint32 des_access = SEC_RIGHTS_MAXIMUM_ALLOWED; BOOL got_dom_pol = False, got_user_pol = False; - if (!(mem_ctx = talloc_init())) - return False; - /* Get sam handle */ if (!(hnd = cm_get_sam_handle(domain->name))) @@ -639,8 +635,6 @@ BOOL winbindd_lookup_usergroups(struct winbindd_domain *domain, if (got_dom_pol) cli_samr_close(hnd->cli, mem_ctx, &dom_pol); - talloc_destroy(mem_ctx); - return NT_STATUS_IS_OK(result); } -- cgit