diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-05-28 22:12:00 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-05-28 22:12:00 +1000 |
commit | 67b83d2489788f1899c253fdab554d0998f9c044 (patch) | |
tree | 637060cb6bd4ab16fa9464d2bc168ad6c99e0b11 /source3/winbindd/winbindd_ads.c | |
parent | 08be1420ba52ef9bba90d0f811c7810841ee8568 (diff) | |
parent | e63d9c29c99c5311c9f4a8dbe432ff4cea4fb924 (diff) | |
download | samba-67b83d2489788f1899c253fdab554d0998f9c044.tar.gz samba-67b83d2489788f1899c253fdab554d0998f9c044.tar.bz2 samba-67b83d2489788f1899c253fdab554d0998f9c044.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/winbindd/winbindd_ads.c')
-rw-r--r-- | source3/winbindd/winbindd_ads.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c index dcf5623d29..0f40419a0e 100644 --- a/source3/winbindd/winbindd_ads.c +++ b/source3/winbindd/winbindd_ads.c @@ -524,14 +524,14 @@ static NTSTATUS query_user(struct winbindd_domain *domain, goto done; } - sidstr = sid_binstring(sid); + sidstr = sid_binstring(talloc_tos(), sid); if (asprintf(&ldap_exp, "(objectSid=%s)", sidstr) == -1) { status = NT_STATUS_NO_MEMORY; goto done; } rc = ads_search_retry(ads, &msg, ldap_exp, attrs); free(ldap_exp); - free(sidstr); + TALLOC_FREE(sidstr); if (!ADS_ERR_OK(rc) || !msg) { DEBUG(1,("query_user(sid=%s) ads_search: %s\n", sid_string_dbg(sid), ads_errstr(rc))); @@ -1011,21 +1011,19 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain, goto done; } - if ((sidbinstr = sid_binstring(group_sid)) == NULL) { + if ((sidbinstr = sid_binstring(talloc_tos(), group_sid)) == NULL) { status = NT_STATUS_NO_MEMORY; goto done; } /* search for all members of the group */ - if (!(ldap_exp = talloc_asprintf(tmp_ctx, "(objectSid=%s)", - sidbinstr))) - { - SAFE_FREE(sidbinstr); + ldap_exp = talloc_asprintf(tmp_ctx, "(objectSid=%s)", sidbinstr); + TALLOC_FREE(sidbinstr); + if (ldap_exp == NULL) { DEBUG(1, ("ads: lookup_groupmem: talloc_asprintf for ldap_exp failed!\n")); status = NT_STATUS_NO_MEMORY; goto done; } - SAFE_FREE(sidbinstr); args.control = ADS_EXTENDED_DN_OID; args.val = ADS_EXTENDED_DN_HEX_STRING; |