From 44631bfd4d418cbf1ca4309057e6161cdce50bd4 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 25 Dec 2007 03:34:04 +0100 Subject: [PATCH] Remove talloc context parameter from libnet_smbconf_delparm(). Make use of talloc stackframe internally. This removes talloc contxt from net_conf_delparm. Michael (This used to be commit 16f137393881edc78c9322f038ba38e53e3ee07d) --- source3/libnet/libnet_conf.c | 6 +++--- source3/libnet/libnet_join.c | 2 +- source3/utils/net_conf.c | 5 +---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/source3/libnet/libnet_conf.c b/source3/libnet/libnet_conf.c index 6ea97a82eb8..bb0e637b332 100644 --- a/source3/libnet/libnet_conf.c +++ b/source3/libnet/libnet_conf.c @@ -366,12 +366,12 @@ done: return werr; } -WERROR libnet_smbconf_delparm(TALLOC_CTX *mem_ctx, - const char *service, +WERROR libnet_smbconf_delparm(const char *service, const char *param) { struct registry_key *key = NULL; WERROR werr = WERR_OK; + TALLOC_CTX *mem_ctx = talloc_stackframe(); if (!libnet_smbconf_key_exists(service)) { return WERR_NO_SUCH_SERVICE; @@ -390,7 +390,7 @@ WERROR libnet_smbconf_delparm(TALLOC_CTX *mem_ctx, werr = reg_deletevalue(key, param); done: - TALLOC_FREE(key); + TALLOC_FREE(mem_ctx); return werr; } diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 4f5c09cf47d..e8d114d7477 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -381,7 +381,7 @@ static WERROR do_unjoin_modify_vals_config(TALLOC_CTX *mem_ctx, W_ERROR_NOT_OK_RETURN(werr); } - werr = libnet_smbconf_delparm(mem_ctx, "GLOBAL", "realm"); + werr = libnet_smbconf_delparm("GLOBAL", "realm"); return werr; } diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index 5d8b6d605bd..5dc1eb06f4b 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -846,9 +846,6 @@ static int net_conf_delparm(int argc, const char **argv) WERROR werr = WERR_OK; char *service = NULL; char *param = NULL; - TALLOC_CTX *ctx; - - ctx = talloc_init("delparm"); if (argc != 2) { net_conf_delparm_usage(argc, argv); @@ -857,7 +854,7 @@ static int net_conf_delparm(int argc, const char **argv) service = strdup_lower(argv[0]); param = strdup_lower(argv[1]); - werr = libnet_smbconf_delparm(ctx, service, param); + werr = libnet_smbconf_delparm(service, param); if (W_ERROR_EQUAL(werr, WERR_NO_SUCH_SERVICE)) { d_fprintf(stderr,