From 5b6ad54f43741c0c25b35e44cafe5fed352ff133 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Mon, 22 Mar 2010 19:47:49 +0100 Subject: s4:registry - "util" - add also a memory context argument for "reg_key_del_abs" --- source4/lib/registry/registry.h | 3 ++- source4/lib/registry/util.c | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/registry/registry.h b/source4/lib/registry/registry.h index 3ac50d517d..8fe26cecd5 100644 --- a/source4/lib/registry/registry.h +++ b/source4/lib/registry/registry.h @@ -460,7 +460,8 @@ bool reg_string_to_val(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_ const char *data_str, uint32_t *type, DATA_BLOB *data); WERROR reg_open_key_abs(TALLOC_CTX *mem_ctx, struct registry_context *handle, const char *name, struct registry_key **result); -WERROR reg_key_del_abs(struct registry_context *ctx, const char *path); +WERROR reg_key_del_abs(TALLOC_CTX *mem_ctx, struct registry_context *ctx, + const char *path); WERROR reg_key_add_abs(TALLOC_CTX *mem_ctx, struct registry_context *ctx, const char *path, uint32_t access_mask, struct security_descriptor *sec_desc, diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c index fc5244a151..8c855c25ed 100644 --- a/source4/lib/registry/util.c +++ b/source4/lib/registry/util.c @@ -234,11 +234,11 @@ static WERROR get_abs_parent(TALLOC_CTX *mem_ctx, struct registry_context *ctx, return WERR_OK; } -WERROR reg_key_del_abs(struct registry_context *ctx, const char *path) +WERROR reg_key_del_abs(TALLOC_CTX *mem_ctx, struct registry_context *ctx, + const char *path) { struct registry_key *parent; const char *n; - TALLOC_CTX *mem_ctx = talloc_init("reg_key_del_abs"); WERROR error; if (!strchr(path, '\\')) { @@ -250,8 +250,6 @@ WERROR reg_key_del_abs(struct registry_context *ctx, const char *path) error = reg_key_del(mem_ctx, parent, n); } - talloc_free(mem_ctx); - talloc_free(parent); talloc_free(n); -- cgit