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 | 2b7b5e9ece6cf81ff2efbdd5b7bc2b2b2baf8e9c (patch) | |
tree | 0b9126be9a75ad9026363e9a32d0b2bc2d606a36 | |
parent | b283a205da69db7b2ee3ae7e0a37532660707476 (diff) | |
download | samba-2b7b5e9ece6cf81ff2efbdd5b7bc2b2b2baf8e9c.tar.gz samba-2b7b5e9ece6cf81ff2efbdd5b7bc2b2b2baf8e9c.tar.bz2 samba-2b7b5e9ece6cf81ff2efbdd5b7bc2b2b2baf8e9c.zip |
r15980: Correctly destroy talloc_ctx when the LDAP posix attribute query has
failed. Noticed by Bob Gautier.
Guenther
(This used to be commit 7327f94546a90df25c688dcafd42e0993133057a)
-rw-r--r-- | source3/libads/ldap_schema.c | 15 |
1 files 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); |