summaryrefslogtreecommitdiffstats
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-11-18 08:48:30 +0100
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-11-27 23:23:32 +0100
commitf7c28db475261fa859e8f1888a629ced6c447c60 (patch)
tree496ee543ea8c3d757d707ec6b5c404b6347c16b2 /source4
parent6f7cfb0e10a1967a59ff18221bd9941edcbc8790 (diff)
downloadsamba-f7c28db475261fa859e8f1888a629ced6c447c60.tar.gz
samba-f7c28db475261fa859e8f1888a629ced6c447c60.tar.xz
samba-f7c28db475261fa859e8f1888a629ced6c447c60.zip
s4:WINREG RPC server - add another "talloc_unlink" in "DeleteKey"
Also here we waste memory - therefore free the pointless handle after the delete.
Diffstat (limited to 'source4')
-rw-r--r--source4/rpc_server/winreg/rpc_winreg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/rpc_server/winreg/rpc_winreg.c b/source4/rpc_server/winreg/rpc_winreg.c
index ba619c02f7c..13c311cd960 100644
--- a/source4/rpc_server/winreg/rpc_winreg.c
+++ b/source4/rpc_server/winreg/rpc_winreg.c
@@ -166,6 +166,7 @@ static WERROR dcesrv_winreg_DeleteKey(struct dcesrv_call_state *dce_call,
{
struct dcesrv_handle *h;
struct registry_key *key;
+ WERROR result;
DCESRV_PULL_HANDLE_FAULT(h, r->in.handle, HTYPE_REGKEY);
key = h->data;
@@ -174,7 +175,10 @@ static WERROR dcesrv_winreg_DeleteKey(struct dcesrv_call_state *dce_call,
{
case SECURITY_SYSTEM:
case SECURITY_ADMINISTRATOR:
- return reg_key_del(key, r->in.key.name);
+ result = reg_key_del(key, r->in.key.name);
+ talloc_unlink(dce_call->context, h);
+
+ return result;
default:
return WERR_ACCESS_DENIED;
}