summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-05-27 18:40:13 +0200
committerVolker Lendecke <vl@samba.org>2009-05-28 10:52:04 +0200
commitd07464b21fe652e205f5eb2c74d12495bab100ce (patch)
tree596131c756df6817752c71f7644a29df3f8c8140 /source3
parent3194ad2838bedee3eff60c767552d8a801b5eb70 (diff)
downloadsamba-d07464b21fe652e205f5eb2c74d12495bab100ce.tar.gz
samba-d07464b21fe652e205f5eb2c74d12495bab100ce.tar.bz2
samba-d07464b21fe652e205f5eb2c74d12495bab100ce.zip
Do not segfault in pdb_search_destructor if no real search was started
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/pdb_interface.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index 340867a5a6..164e5853df 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -1711,7 +1711,7 @@ static NTSTATUS pdb_default_lookup_names(struct pdb_methods *methods,
static int pdb_search_destructor(struct pdb_search *search)
{
- if (!search->search_ended) {
+ if ((!search->search_ended) && (search->search_end != NULL)) {
search->search_end(search);
}
return 0;
@@ -1733,6 +1733,7 @@ struct pdb_search *pdb_search_init(TALLOC_CTX *mem_ctx,
result->num_entries = 0;
result->cache_size = 0;
result->search_ended = False;
+ result->search_end = NULL;
/* Segfault appropriately if not initialized */
result->next_entry = NULL;