summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-02-04 19:33:56 +0100
committerVolker Lendecke <vl@samba.org>2008-02-04 19:41:04 +0100
commita31d5e49feb04924620996fef57c336ca5bd7251 (patch)
tree34b41eef92cb821a93a09e1d16bbaafd0913129f
parentb47672656bc762fb5f5d7136769591449cd4c0f1 (diff)
downloadsamba-a31d5e49feb04924620996fef57c336ca5bd7251.tar.gz
samba-a31d5e49feb04924620996fef57c336ca5bd7251.tar.bz2
samba-a31d5e49feb04924620996fef57c336ca5bd7251.zip
Fix valgrind errors
We need to keep the names around on the search. Probably a tdb_move would do it here as well, but RPC is not the fastest thing on earth anyway... Thanks to Günther for pointing that out to me! (This used to be commit c9472ae61039adf178e047d89dbcc698dfa57059)
-rw-r--r--source3/passdb/pdb_smbpasswd.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c
index 6cf54fbdf6..70944a9596 100644
--- a/source3/passdb/pdb_smbpasswd.c
+++ b/source3/passdb/pdb_smbpasswd.c
@@ -1559,8 +1559,24 @@ static bool smbpasswd_search_next_entry(struct pdb_search *search,
return false;
}
- *entry = state->entries[state->current++];
+ entry->idx = state->entries[state->current].idx;
+ entry->rid = state->entries[state->current].rid;
+ entry->acct_flags = state->entries[state->current].acct_flags;
+
+ entry->account_name = talloc_strdup(
+ search->mem_ctx, state->entries[state->current].account_name);
+ entry->fullname = talloc_strdup(
+ search->mem_ctx, state->entries[state->current].fullname);
+ entry->description = talloc_strdup(
+ search->mem_ctx, state->entries[state->current].description);
+
+ if ((entry->account_name == NULL) || (entry->fullname == NULL)
+ || (entry->description == NULL)) {
+ DEBUG(0, ("talloc_strdup failed\n"));
+ return false;
+ }
+ state->current += 1;
return true;
}