From c79e0c0ce4a6689a6cd8ded7cb273d17b6be6211 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 28 Jun 2010 11:20:23 +0200 Subject: s3: Do an early TALLOC_FREE --- source3/winbindd/winbindd_ads.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/winbindd/winbindd_ads.c') 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))); -- cgit