summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-10-18 21:37:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:21:25 -0500
commit403f0c92a734a9bf7709a0af0a0aa9cc89bf3144 (patch)
tree2a3f9cf59c9544c5e667b3dd00387b61908e167e /source4/lib/registry
parentf8a82ebe2b8690a847243cc482c39cd7d412e089 (diff)
downloadsamba-403f0c92a734a9bf7709a0af0a0aa9cc89bf3144.tar.gz
samba-403f0c92a734a9bf7709a0af0a0aa9cc89bf3144.tar.bz2
samba-403f0c92a734a9bf7709a0af0a0aa9cc89bf3144.zip
r19400: fixed a valgrind error in the directory registry backend (name was
used after closedir(), which invalidates the name) (This used to be commit d8af519c2d2fcab3baa822c5fd4c1079dcbd1de3)
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/reg_backend_dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/lib/registry/reg_backend_dir.c b/source4/lib/registry/reg_backend_dir.c
index beedc0615b..8348f6c38a 100644
--- a/source4/lib/registry/reg_backend_dir.c
+++ b/source4/lib/registry/reg_backend_dir.c
@@ -99,9 +99,9 @@ static WERROR reg_dir_key_by_index(TALLOC_CTX *mem_ctx, const struct registry_ke
if(S_ISDIR(stbuf.st_mode)) {
if(i == idx) {
(*key) = talloc(mem_ctx, struct registry_key);
- (*key)->name = e->d_name;
+ (*key)->name = talloc_strdup(*key, e->d_name);
(*key)->path = NULL;
- (*key)->backend_data = talloc_strdup(mem_ctx, thispath);
+ (*key)->backend_data = talloc_strdup(*key, thispath);
SAFE_FREE(thispath);
closedir(d);
return WERR_OK;