From 403f0c92a734a9bf7709a0af0a0aa9cc89bf3144 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 18 Oct 2006 21:37:37 +0000 Subject: 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) --- source4/lib/registry/reg_backend_dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4') 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; -- cgit