summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-06-28 11:20:23 +0200
committerVolker Lendecke <vl@samba.org>2010-06-28 13:54:44 +0200
commitc79e0c0ce4a6689a6cd8ded7cb273d17b6be6211 (patch)
tree3d740989261edc1b5e86c4c23c88df56edc0366b /source3/winbindd
parent658048ecbc417a9632e32f64107f4d31d3dea725 (diff)
downloadsamba-c79e0c0ce4a6689a6cd8ded7cb273d17b6be6211.tar.gz
samba-c79e0c0ce4a6689a6cd8ded7cb273d17b6be6211.tar.bz2
samba-c79e0c0ce4a6689a6cd8ded7cb273d17b6be6211.zip
s3: Do an early TALLOC_FREE
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/winbindd_ads.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c
index 00b53a205c..2b63c43003 100644
--- a/source3/winbindd/winbindd_ads.c
+++ b/source3/winbindd/winbindd_ads.c
@@ -464,6 +464,7 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
struct netr_SamInfo3 *user = NULL;
gid_t gid;
+ int ret;
DEBUG(3,("ads: query_user\n"));
@@ -527,13 +528,15 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
}
sidstr = sid_binstring(talloc_tos(), sid);
- if (asprintf(&ldap_exp, "(objectSid=%s)", sidstr) == -1) {
+
+ ret = asprintf(&ldap_exp, "(objectSid=%s)", sidstr);
+ TALLOC_FREE(sidstr);
+ if (ret == -1) {
status = NT_STATUS_NO_MEMORY;
goto done;
}
rc = ads_search_retry(ads, &msg, ldap_exp, attrs);
free(ldap_exp);
- 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)));