diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-05-28 22:12:00 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-05-28 22:12:00 +1000 |
commit | 67b83d2489788f1899c253fdab554d0998f9c044 (patch) | |
tree | 637060cb6bd4ab16fa9464d2bc168ad6c99e0b11 /source3/passdb/pdb_interface.c | |
parent | 08be1420ba52ef9bba90d0f811c7810841ee8568 (diff) | |
parent | e63d9c29c99c5311c9f4a8dbe432ff4cea4fb924 (diff) | |
download | samba-67b83d2489788f1899c253fdab554d0998f9c044.tar.gz samba-67b83d2489788f1899c253fdab554d0998f9c044.tar.bz2 samba-67b83d2489788f1899c253fdab554d0998f9c044.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/passdb/pdb_interface.c')
-rw-r--r-- | source3/passdb/pdb_interface.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index 340867a5a6..b4e1bd436c 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; @@ -2021,7 +2022,8 @@ NTSTATUS make_pdb_method( struct pdb_methods **methods ) { /* allocate memory for the structure as its own talloc CTX */ - if ( !(*methods = TALLOC_ZERO_P(talloc_autofree_context(), struct pdb_methods) ) ) { + *methods = talloc_zero(talloc_autofree_context(), struct pdb_methods); + if (*methods == NULL) { return NT_STATUS_NO_MEMORY; } |