- /* fetching trusted domains' data and collecting them in a list */
- keys = tdb_search_keys(tdb, pattern);
-
- /* searching for keys in secrets db -- way to go ... */
- for (k = keys; k; k = k->next) {
- uint8 *packed_pass;
- size_t size = 0, packed_size = 0;
- struct trusted_dom_pass pass;
- char *secrets_key;
- struct trustdom_info *dom_info;
-
- /* important: ensure null-termination of the key string */
- secrets_key = talloc_strndup(tmp_ctx,
- (const char *)k->node_key.dptr,
- k->node_key.dsize);
- if (!secrets_key) {
- DEBUG(0, ("strndup failed!\n"));
- tdb_search_list_free(keys);
- TALLOC_FREE(tmp_ctx);
- return NT_STATUS_NO_MEMORY;
- }