summaryrefslogtreecommitdiff
path: root/source4/lib/registry/tools
diff options
context:
space:
mode:
authorscudette@gmail.com <scudette@gmail.com>2009-01-02 22:40:32 +1100
committerVolker Lendecke <vl@samba.org>2009-01-02 20:55:20 +0100
commitcc9771d3daa84994ceec427127a71a3cf0a34b9a (patch)
tree26f67d33618204525a9042575191992641599d3c /source4/lib/registry/tools
parentde58ef45ac0510bfa510fed54010f1de67e83953 (diff)
downloadsamba-cc9771d3daa84994ceec427127a71a3cf0a34b9a.tar.gz
samba-cc9771d3daa84994ceec427127a71a3cf0a34b9a.tar.bz2
samba-cc9771d3daa84994ceec427127a71a3cf0a34b9a.zip
Memory leak fixed due to accumulation of open reg keys.
Diffstat (limited to 'source4/lib/registry/tools')
-rw-r--r--source4/lib/registry/tools/regtree.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c
index cca009a0e2..948ed49312 100644
--- a/source4/lib/registry/tools/regtree.c
+++ b/source4/lib/registry/tools/regtree.c
@@ -55,13 +55,16 @@ static void print_tree(int level, struct registry_key *p,
&keyname,
NULL,
NULL)); i++) {
- SMB_ASSERT(strlen(keyname) > 0);
+
+ SMB_ASSERT(strlen(keyname) > 0);
if (!W_ERROR_IS_OK(reg_open_key(mem_ctx, p, keyname, &subkey)))
- continue;
+ continue;
+
print_tree(level+1, subkey, (fullpath && strlen(name))?
- talloc_asprintf(mem_ctx, "%s\\%s",
- name, keyname):
- keyname, fullpath, novals);
+ talloc_asprintf(mem_ctx, "%s\\%s",
+ name, keyname):
+ keyname, fullpath, novals);
+ talloc_free(subkey);
}
talloc_free(mem_ctx);