summaryrefslogtreecommitdiff
path: root/source3/libads/sitename_cache.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-09-04 13:58:18 -0700
committerJeremy Allison <jra@samba.org>2013-09-05 09:17:27 -0700
commit32037e0533f720ebbd3f49c5951c4ef30aac9985 (patch)
treef9db5cdac1da5bd09fb0e2a6e373a96a9847c08b /source3/libads/sitename_cache.c
parent6b915bfd0f4194453c1b01158f2c2772b2a2df2f (diff)
downloadsamba-32037e0533f720ebbd3f49c5951c4ef30aac9985.tar.gz
Add a talloc context to sitename_fetch().
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/libads/sitename_cache.c')
-rw-r--r--source3/libads/sitename_cache.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/libads/sitename_cache.c b/source3/libads/sitename_cache.c
index b0c4423106e..b064aea1397 100644
--- a/source3/libads/sitename_cache.c
+++ b/source3/libads/sitename_cache.c
@@ -79,7 +79,7 @@ bool sitename_store(const char *realm, const char *sitename)
Caller must free.
****************************************************************************/
-char *sitename_fetch(const char *realm)
+char *sitename_fetch(TALLOC_CTX *mem_ctx, const char *realm)
{
char *sitename = NULL;
time_t timeout;
@@ -95,7 +95,7 @@ char *sitename_fetch(const char *realm)
key = sitename_key(query_realm);
- ret = gencache_get( key, NULL, &sitename, &timeout );
+ ret = gencache_get( key, mem_ctx, &sitename, &timeout );
SAFE_FREE(key);
if ( !ret ) {
DEBUG(5,("sitename_fetch: No stored sitename for %s\n",
@@ -122,7 +122,7 @@ bool stored_sitename_changed(const char *realm, const char *sitename)
return False;
}
- new_sitename = sitename_fetch(realm);
+ new_sitename = sitename_fetch(talloc_tos(), realm);
if (sitename && new_sitename && !strequal(sitename, new_sitename)) {
ret = True;
@@ -130,7 +130,7 @@ bool stored_sitename_changed(const char *realm, const char *sitename)
(!sitename && new_sitename)) {
ret = True;
}
- SAFE_FREE(new_sitename);
+ TALLOC_FREE(new_sitename);
return ret;
}