git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2ed463e
)
r19400: fixed a valgrind error in the directory registry backend (name was
author
Andrew Tridgell
<tridge@samba.org>
Wed, 18 Oct 2006 21:37:37 +0000
(21:37 +0000)
committer
Gerald (Jerry) Carter
<jerry@samba.org>
Wed, 10 Oct 2007 19:21:25 +0000
(14:21 -0500)
used after closedir(), which invalidates the name)
source/lib/registry/reg_backend_dir.c
patch
|
blob
|
history
diff --git
a/source/lib/registry/reg_backend_dir.c
b/source/lib/registry/reg_backend_dir.c
index beedc0615b68aadcc6d94c103432eee3bd3d98e7..8348f6c38a31051143890a8970c78833d3e5faa4 100644
(file)
--- a/
source/lib/registry/reg_backend_dir.c
+++ b/
source/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;