summaryrefslogtreecommitdiff
path: root/source3/passdb/secrets.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-12-07 18:25:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:32 -0500
commitacf9d61421faa6c0055d57fdee7db300dc5431aa (patch)
tree5482afecfe9b4a68b9a1f18d541a3109f8143ab7 /source3/passdb/secrets.c
parent3bd3be97dc8a581c0502410453091c195e322766 (diff)
downloadsamba-acf9d61421faa6c0055d57fdee7db300dc5431aa.tar.gz
samba-acf9d61421faa6c0055d57fdee7db300dc5431aa.tar.bz2
samba-acf9d61421faa6c0055d57fdee7db300dc5431aa.zip
r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy. (This used to be commit 620f2e608f70ba92f032720c031283d295c5c06a)
Diffstat (limited to 'source3/passdb/secrets.c')
-rw-r--r--source3/passdb/secrets.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index 426217b82c..6be63e4f9d 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -346,7 +346,7 @@ BOOL secrets_fetch_trusted_domain_password(const char *domain, char** pwd,
/* the trust's password */
if (pwd) {
- *pwd = strdup(pass.pass);
+ *pwd = SMB_STRDUP(pass.pass);
if (!*pwd) {
return False;
}
@@ -577,7 +577,7 @@ NTSTATUS secrets_get_trusted_domains(TALLOC_CTX* ctx, int* enum_ctx, unsigned in
size_t size, packed_size = 0;
fstring dom_name;
char *packed_pass;
- struct trusted_dom_pass *pass = talloc_zero(ctx, sizeof(struct trusted_dom_pass));
+ struct trusted_dom_pass *pass = TALLOC_ZERO_P(ctx, struct trusted_dom_pass);
NTSTATUS status;
if (!secrets_init()) return NT_STATUS_ACCESS_DENIED;
@@ -599,7 +599,7 @@ NTSTATUS secrets_get_trusted_domains(TALLOC_CTX* ctx, int* enum_ctx, unsigned in
DEBUG(5, ("secrets_get_trusted_domains: looking for %d domains, starting at index %d\n",
max_num_domains, *enum_ctx));
- *domains = talloc_zero(ctx, sizeof(**domains)*max_num_domains);
+ *domains = TALLOC_ZERO_ARRAY(ctx, TRUSTDOM *, max_num_domains);
/* fetching trusted domains' data and collecting them in a list */
keys = tdb_search_keys(tdb, pattern);
@@ -615,7 +615,7 @@ NTSTATUS secrets_get_trusted_domains(TALLOC_CTX* ctx, int* enum_ctx, unsigned in
char *secrets_key;
/* important: ensure null-termination of the key string */
- secrets_key = strndup(k->node_key.dptr, k->node_key.dsize);
+ secrets_key = SMB_STRNDUP(k->node_key.dptr, k->node_key.dsize);
if (!secrets_key) {
DEBUG(0, ("strndup failed!\n"));
return NT_STATUS_NO_MEMORY;
@@ -638,7 +638,7 @@ NTSTATUS secrets_get_trusted_domains(TALLOC_CTX* ctx, int* enum_ctx, unsigned in
SAFE_FREE(secrets_key);
if (idx >= start_idx && idx < start_idx + max_num_domains) {
- dom = talloc_zero(ctx, sizeof(*dom));
+ dom = TALLOC_ZERO_P(ctx, TRUSTDOM);
if (!dom) {
/* free returned tdb record */
return NT_STATUS_NO_MEMORY;