diff options
author | Günther Deschner <gd@samba.org> | 2006-09-06 13:20:06 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:43:30 -0500 |
commit | b5f6cbbe1be4379a1ebab1f70ef05af838d48fb7 (patch) | |
tree | 5eb3659ea33ef82031aebc79fb5865515b4a6003 /source3/libads | |
parent | 171a5cd5c01e120cac6c9dadaccd90e98ad836e4 (diff) | |
download | samba-b5f6cbbe1be4379a1ebab1f70ef05af838d48fb7.tar.gz samba-b5f6cbbe1be4379a1ebab1f70ef05af838d48fb7.tar.bz2 samba-b5f6cbbe1be4379a1ebab1f70ef05af838d48fb7.zip |
r18177: Some build- and memleak-fixes for the (not build by default) ADS GPO
routines.
Guenther
(This used to be commit 0ef504a0a6dc8f5db1dbc7f2410aa981e11fd56c)
Diffstat (limited to 'source3/libads')
-rw-r--r-- | source3/libads/gpo_util.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/libads/gpo_util.c b/source3/libads/gpo_util.c index 8f913c1971..7df38eb125 100644 --- a/source3/libads/gpo_util.c +++ b/source3/libads/gpo_util.c @@ -445,7 +445,7 @@ ADS_STATUS gpo_password_policy(ADS_STRUCT *ads, struct GROUP_POLICY_OBJECT *gpo_list; const char *attrs[] = {"distinguishedName", "userAccountControl", NULL}; char *filter, *dn; - void *res = NULL; + LDAPMessage *res = NULL; uint32 uac; return ADS_ERROR_NT(NT_STATUS_NOT_IMPLEMENTED); @@ -473,15 +473,18 @@ ADS_STATUS gpo_password_policy(ADS_STRUCT *ads, } if (!ads_pull_uint32(ads, res, "userAccountControl", &uac)) { + ads_memfree(ads, dn); return ADS_ERROR(LDAP_NO_MEMORY); } if (!(uac & UF_WORKSTATION_TRUST_ACCOUNT)) { + ads_memfree(ads, dn); return ADS_ERROR(LDAP_NO_SUCH_OBJECT); } status = ads_get_gpo_list(ads, mem_ctx, dn, GPO_LIST_FLAG_MACHINE, &gpo_list); if (!ADS_ERR_OK(status)) { + ads_memfree(ads, dn); return status; } @@ -489,8 +492,10 @@ ADS_STATUS gpo_password_policy(ADS_STRUCT *ads, cse_gpo_name_to_guid_string("Security"), GPO_LIST_FLAG_MACHINE); if (!ADS_ERR_OK(status)) { + ads_memfree(ads, dn); return status; } + ads_memfree(ads, dn); return ADS_ERROR(LDAP_SUCCESS); } |