summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-04-13 01:42:46 +0200
committerMichael Adam <obnox@samba.org>2008-04-13 01:43:43 +0200
commit0fa8845fa0aa8df0480a85560dabe7b1b7d7926b (patch)
treed89a268e1490a16e19e1387e6b21e63e245afade /source3
parent227904434a1ce46a9d314c20c80fb82fafd4684a (diff)
downloadsamba-0fa8845fa0aa8df0480a85560dabe7b1b7d7926b.tar.gz
samba-0fa8845fa0aa8df0480a85560dabe7b1b7d7926b.tar.bz2
samba-0fa8845fa0aa8df0480a85560dabe7b1b7d7926b.zip
registry cachehook: fix memleak (to talloc_tos()): free key at the end.
Michael (This used to be commit 3f5955d361da5278773b46dccb34c8f63eb04157)
Diffstat (limited to 'source3')
-rw-r--r--source3/registry/reg_cachehook.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/registry/reg_cachehook.c b/source3/registry/reg_cachehook.c
index bb190411ee..705d08abf8 100644
--- a/source3/registry/reg_cachehook.c
+++ b/source3/registry/reg_cachehook.c
@@ -69,6 +69,7 @@ bool reghook_cache_init( void )
bool reghook_cache_add(const char *keyname, REGISTRY_OPS *ops)
{
+ bool ret;
char *key = NULL;
key = keyname_to_path(talloc_tos(), keyname);
@@ -80,7 +81,9 @@ bool reghook_cache_add(const char *keyname, REGISTRY_OPS *ops)
DEBUG(10, ("reghook_cache_add: Adding ops %p for key [%s]\n",
(void *)ops, key));
- return pathtree_add(cache_tree, key, ops);
+ ret = pathtree_add(cache_tree, key, ops);
+ TALLOC_FREE(key);
+ return ret;
}
/**********************************************************************