summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/include/smbldap.h2
-rw-r--r--source3/passdb/pdb_ldap.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/source3/include/smbldap.h b/source3/include/smbldap.h
index 3e2c878dbe..d9d7aca98e 100644
--- a/source3/include/smbldap.h
+++ b/source3/include/smbldap.h
@@ -141,8 +141,6 @@ void smbldap_make_mod(LDAP *ldap_struct, LDAPMessage *existing,
bool smbldap_get_single_attribute (LDAP * ldap_struct, LDAPMessage * entry,
const char *attribute, char *value,
int max_len);
-bool smbldap_get_single_pstring (LDAP * ldap_struct, LDAPMessage * entry,
- const char *attribute, pstring value);
char *smbldap_get_dn(LDAP *ld, LDAPMessage *entry);
int smbldap_modify(struct smbldap_state *ldap_state,
const char *dn,
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 707e3f3a30..7a3d55999e 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -3403,11 +3403,14 @@ static NTSTATUS ldapsam_setsamgrent(struct pdb_methods *my_methods,
{
struct ldapsam_privates *ldap_state =
(struct ldapsam_privates *)my_methods->private_data;
- fstring filter;
+ char *filter = NULL;
int rc;
const char **attr_list;
- pstr_sprintf( filter, "(objectclass=%s)", LDAP_OBJ_GROUPMAP);
+ filter = talloc_asprintf(NULL, "(objectclass=%s)", LDAP_OBJ_GROUPMAP);
+ if (!filter) {
+ return NT_STATUS_NO_MEMORY;
+ }
attr_list = get_attr_list( NULL, groupmap_attr_list );
rc = smbldap_search(ldap_state->smbldap_state, lp_ldap_group_suffix(),
LDAP_SCOPE_SUBTREE, filter,
@@ -3421,9 +3424,12 @@ static NTSTATUS ldapsam_setsamgrent(struct pdb_methods *my_methods,
lp_ldap_group_suffix(), filter));
ldap_msgfree(ldap_state->result);
ldap_state->result = NULL;
+ TALLOC_FREE(filter);
return NT_STATUS_UNSUCCESSFUL;
}
+ TALLOC_FREE(filter);
+
DEBUG(2, ("ldapsam_setsamgrent: %d entries in the base!\n",
ldap_count_entries(ldap_state->smbldap_state->ldap_struct,
ldap_state->result)));