diff options
author | Günther Deschner <gd@samba.org> | 2006-05-31 10:32:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:17:16 -0500 |
commit | 7327f94546a90df25c688dcafd42e0993133057a (patch) | |
tree | c13325425e097762838a87dcb499fb265a346c78 /source/libads/ldap_schema.c | |
parent | 4addabd054a2627133d3fff71234db18cf2c822c (diff) | |
download | samba-7327f94546a90df25c688dcafd42e0993133057a.tar.gz samba-7327f94546a90df25c688dcafd42e0993133057a.tar.xz samba-7327f94546a90df25c688dcafd42e0993133057a.zip |
r15980: Correctly destroy talloc_ctx when the LDAP posix attribute query has
failed. Noticed by Bob Gautier.
Guenther
Diffstat (limited to 'source/libads/ldap_schema.c')
-rw-r--r-- | source/libads/ldap_schema.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/libads/ldap_schema.c b/source/libads/ldap_schema.c index a0c735208fa..13a8ab0cb0b 100644 --- a/source/libads/ldap_schema.c +++ b/source/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); |