summaryrefslogtreecommitdiffstats
path: root/source/registry
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-12-03 16:51:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:21 -0500
commit281640823bfe25f513f44f6c6d7022a11b957fa5 (patch)
treeebce6d57427c63124c4eb019ba5b34466fa3f0e4 /source/registry
parentfc29a283cc9c2458375aa4fe2ecef82e6a3847df (diff)
downloadsamba-281640823bfe25f513f44f6c6d7022a11b957fa5.tar.gz
samba-281640823bfe25f513f44f6c6d7022a11b957fa5.tar.xz
samba-281640823bfe25f513f44f6c6d7022a11b957fa5.zip
r20018: Fix a memleak in reg_createkey
Diffstat (limited to 'source/registry')
-rw-r--r--source/registry/reg_api.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/registry/reg_api.c b/source/registry/reg_api.c
index 907d0236c70..7abf0538f8e 100644
--- a/source/registry/reg_api.c
+++ b/source/registry/reg_api.c
@@ -334,8 +334,10 @@ WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent,
err = reg_openkey(ctx, key, path, desired_access, pkey);
if (W_ERROR_IS_OK(err)) {
- *paction = REG_OPENED_EXISTING_KEY;
- return WERR_OK;
+ if (paction != NULL) {
+ *paction = REG_OPENED_EXISTING_KEY;
+ }
+ goto done;
}
if (!W_ERROR_EQUAL(err, WERR_BADFILE)) {