From 2b7b5e9ece6cf81ff2efbdd5b7bc2b2b2baf8e9c Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 31 May 2006 10:32:12 +0000 Subject: r15980: Correctly destroy talloc_ctx when the LDAP posix attribute query has failed. Noticed by Bob Gautier. Guenther (This used to be commit 7327f94546a90df25c688dcafd42e0993133057a) --- source3/libads/ldap_schema.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source3/libads/ldap_schema.c b/source3/libads/ldap_schema.c index a0c735208f..13a8ab0cb0 100644 --- a/source3/libads/ldap_schema.c +++ b/source3/libads/ldap_schema.c @@ -303,13 +303,14 @@ ADS_STATUS ads_check_posix_schema_mapping(ADS_STRUCT *ads, enum wb_posix_mapping } } - talloc_destroy(ctx); - - ADS_ERROR_HAVE_NO_MEMORY(ads->schema.posix_uidnumber_attr); - ADS_ERROR_HAVE_NO_MEMORY(ads->schema.posix_gidnumber_attr); - ADS_ERROR_HAVE_NO_MEMORY(ads->schema.posix_homedir_attr); - ADS_ERROR_HAVE_NO_MEMORY(ads->schema.posix_shell_attr); - ADS_ERROR_HAVE_NO_MEMORY(ads->schema.posix_gecos_attr); + if (!ads->schema.posix_uidnumber_attr || + !ads->schema.posix_gidnumber_attr || + !ads->schema.posix_homedir_attr || + !ads->schema.posix_shell_attr || + !ads->schema.posix_gecos_attr) { + status = ADS_ERROR(LDAP_NO_MEMORY); + goto done; + } status = ADS_ERROR(LDAP_SUCCESS); -- cgit