diff options
author | Jeremy Allison <jra@samba.org> | 2004-05-27 00:04:43 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:51:49 -0500 |
commit | 6b5f46c24558165bd49ed3fd5b187d32dcfc5884 (patch) | |
tree | 79f6b88c6303ff3c6dcd38050b743d19d17807cd /source3/sam | |
parent | bafcb57f11d459de0fc6461adfbf2f695786ae32 (diff) | |
download | samba-6b5f46c24558165bd49ed3fd5b187d32dcfc5884.tar.gz samba-6b5f46c24558165bd49ed3fd5b187d32dcfc5884.tar.bz2 samba-6b5f46c24558165bd49ed3fd5b187d32dcfc5884.zip |
r916: Memory leak fix from kawasa_r@itg.hitachi.co.jp.
Jeremy.
(This used to be commit c336ccf4e8a6340f8d786219fbc7e4e5a7877e4e)
Diffstat (limited to 'source3/sam')
-rw-r--r-- | source3/sam/idmap_ldap.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/sam/idmap_ldap.c b/source3/sam/idmap_ldap.c index 2124fb6879..d83c0bdc4d 100644 --- a/source3/sam/idmap_ldap.c +++ b/source3/sam/idmap_ldap.c @@ -711,8 +711,12 @@ static NTSTATUS verify_idpool( void ) get_attr_key2string(idpool_attr_list, LDAP_ATTR_UIDNUMBER), uid_str ); smbldap_set_mod( &mods, LDAP_MOD_ADD, get_attr_key2string(idpool_attr_list, LDAP_ATTR_GIDNUMBER), gid_str ); - - rc = smbldap_modify(ldap_state.smbldap_state, lp_ldap_idmap_suffix(), mods); + if (mods) { + rc = smbldap_modify(ldap_state.smbldap_state, lp_ldap_idmap_suffix(), mods); + ldap_mods_free( mods, True ); + } else { + return NT_STATUS_UNSUCCESSFUL; + } } return ( rc==LDAP_SUCCESS ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL ); |