diff options
author | Gregor Beck <gbeck@sernet.de> | 2011-05-30 09:31:21 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-05-30 18:53:28 +0200 |
commit | 723ba6024c4821a8902dba0248dfab70f56a8203 (patch) | |
tree | e81b890a4f0c5502f81b99da72e4d725ac2bd1e4 | |
parent | 0d746f653e76de52985d543a15fd6ee3bf2f4823 (diff) | |
download | samba-723ba6024c4821a8902dba0248dfab70f56a8203.tar.gz samba-723ba6024c4821a8902dba0248dfab70f56a8203.tar.bz2 samba-723ba6024c4821a8902dba0248dfab70f56a8203.zip |
s3:net: registry export: close key after recursion returns
Signed-off-by: Michael Adam <obnox@samba.org>
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Mon May 30 18:53:28 CEST 2011 on sn-devel-104
-rw-r--r-- | source3/utils/net_registry.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/utils/net_registry.c b/source3/utils/net_registry.c index 961cfc1553..ab8fb4e3a7 100644 --- a/source3/utils/net_registry.c +++ b/source3/utils/net_registry.c @@ -1100,7 +1100,6 @@ static int registry_export(TALLOC_CTX *ctx, /*const*/ struct registry_key* key, struct registry_value *valvalue = NULL; char *valname = NULL; - struct registry_key* subkey = NULL; char *subkey_name = NULL; NTTIME modtime = 0; @@ -1126,6 +1125,8 @@ static int registry_export(TALLOC_CTX *ctx, /*const*/ struct registry_key* key, W_ERROR_IS_OK(werr); count++) { + struct registry_key* subkey = NULL; + werr = reg_openkey(ctx, key, subkey_name, REG_KEY_READ, &subkey); if (!W_ERROR_IS_OK(werr)) { @@ -1135,6 +1136,7 @@ static int registry_export(TALLOC_CTX *ctx, /*const*/ struct registry_key* key, } registry_export(ctx, subkey, f); + TALLOC_FREE(subkey); } if (!W_ERROR_EQUAL(WERR_NO_MORE_ITEMS, werr)) { d_fprintf(stderr, _("reg_enumkey failed: %s\n"), |