summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-12-24 00:56:24 +0100
committerMichael Adam <obnox@samba.org>2007-12-24 00:56:24 +0100
commit434f0bcb02fe9df247527e1fa0372c94359f2f07 (patch)
tree7c353f5f7e3ef0948a274a470fe2d12cf9c765f6
parentc74579f49149171e731ae9b5a8e77c579d120cbb (diff)
downloadsamba-434f0bcb02fe9df247527e1fa0372c94359f2f07.tar.gz
samba-434f0bcb02fe9df247527e1fa0372c94359f2f07.tar.bz2
samba-434f0bcb02fe9df247527e1fa0372c94359f2f07.zip
Make libnet_smbconf_value_exists() use talloc_stackframe().
And not pass a talloc context. Michael (This used to be commit 2983aba9d092e6ede43f6eb521c17fe3f304d041)
-rw-r--r--source3/libnet/libnet_conf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/libnet/libnet_conf.c b/source3/libnet/libnet_conf.c
index 26e17f2ea3..35eb740588 100644
--- a/source3/libnet/libnet_conf.c
+++ b/source3/libnet/libnet_conf.c
@@ -78,12 +78,12 @@ bool libnet_smbconf_key_exists(const char *subkeyname)
return ret;
}
-static bool libnet_smbconf_value_exists(TALLOC_CTX *ctx,
- struct registry_key *key,
+static bool libnet_smbconf_value_exists(struct registry_key *key,
const char *param)
{
bool ret = False;
WERROR werr = WERR_OK;
+ TALLOC_CTX *ctx = talloc_stackframe();
struct registry_value *value = NULL;
werr = reg_queryvalue(ctx, key, param, &value);
@@ -91,7 +91,7 @@ static bool libnet_smbconf_value_exists(TALLOC_CTX *ctx,
ret = True;
}
- TALLOC_FREE(value);
+ TALLOC_FREE(ctx);
return ret;
}
@@ -283,7 +283,7 @@ WERROR libnet_smbconf_getparm(TALLOC_CTX *mem_ctx,
goto done;
}
- if (!libnet_smbconf_value_exists(mem_ctx, key, param)) {
+ if (!libnet_smbconf_value_exists(key, param)) {
werr = WERR_INVALID_PARAM;
goto done;
}
@@ -309,7 +309,7 @@ WERROR libnet_smbconf_delparm(TALLOC_CTX *mem_ctx,
werr = libnet_smbconf_open_path(mem_ctx, service, REG_KEY_ALL, &key);
W_ERROR_NOT_OK_RETURN(werr);
- if (!libnet_smbconf_value_exists(mem_ctx, key, param)) {
+ if (!libnet_smbconf_value_exists(key, param)) {
return WERR_INVALID_PARAM;
}