From 20501876735fc4656083747ba8aa0de9da8fb820 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 18 Mar 2009 17:35:03 +1100 Subject: s3:libads Make ads_get_dn() take a talloc context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also remove ads_memfree(), which was only ever a wrapper around SAFE_FREE, used only to free the DN from ads_get_ds(). This actually makes libgpo more consistant, as it mixed a talloc and a malloc based string on the same element. Andrew Bartlett Signed-off-by: Günther Deschner --- source3/utils/net_ads_gpo.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source3/utils/net_ads_gpo.c') diff --git a/source3/utils/net_ads_gpo.c b/source3/utils/net_ads_gpo.c index 181cba221d..910c78d05a 100644 --- a/source3/utils/net_ads_gpo.c +++ b/source3/utils/net_ads_gpo.c @@ -257,7 +257,7 @@ static int net_ads_gpo_list_all(struct net_context *c, int argc, const char **ar msg; msg = ads_next_entry(ads, msg)) { - if ((dn = ads_get_dn(ads, msg)) == NULL) { + if ((dn = ads_get_dn(ads, mem_ctx, msg)) == NULL) { goto out; } @@ -266,18 +266,16 @@ static int net_ads_gpo_list_all(struct net_context *c, int argc, const char **ar if (!ADS_ERR_OK(status)) { d_printf("ads_parse_gpo failed: %s\n", ads_errstr(status)); - ads_memfree(ads, dn); goto out; } dump_gpo(ads, mem_ctx, &gpo, 0); - ads_memfree(ads, dn); } out: ads_msgfree(ads, res); - talloc_destroy(mem_ctx); + TALLOC_FREE(mem_ctx); ads_destroy(&ads); return 0; -- cgit