From d3c689fc5c80431b7e72150f72465b3d255a6f02 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 4 Sep 2013 08:57:59 +0200 Subject: lib: Use "mem_ctx" arg in gencache_get Signed-off-by: Volker Lendecke Signed-off-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Thu Sep 5 20:09:21 CEST 2013 on sn-devel-104 --- source3/libsmb/conncache.c | 4 ++-- source3/libsmb/namecache.c | 8 ++++---- source3/libsmb/trustdom_cache.c | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/conncache.c b/source3/libsmb/conncache.c index dfc2f471ac..9bf4c56a33 100644 --- a/source3/libsmb/conncache.c +++ b/source3/libsmb/conncache.c @@ -143,13 +143,13 @@ NTSTATUS check_negative_conn_cache( const char *domain, const char *server) if (key == NULL) goto done; - if (gencache_get(key, NULL, &value, NULL)) + if (gencache_get(key, talloc_tos(), &value, NULL)) result = negative_conn_cache_valuedecode(value); done: DEBUG(9,("check_negative_conn_cache returning result %d for domain %s " "server %s\n", NT_STATUS_V(result), domain, server)); TALLOC_FREE(key); - SAFE_FREE(value); + TALLOC_FREE(value); return result; } diff --git a/source3/libsmb/namecache.c b/source3/libsmb/namecache.c index ebd51fd919..1e6158444d 100644 --- a/source3/libsmb/namecache.c +++ b/source3/libsmb/namecache.c @@ -156,7 +156,7 @@ bool namecache_fetch(const char *name, return False; } - if (!gencache_get(key, NULL, &value, &timeout)) { + if (!gencache_get(key, talloc_tos(), &value, &timeout)) { DEBUG(5, ("no entry for %s#%02X found.\n", name, name_type)); SAFE_FREE(key); return False; @@ -170,7 +170,7 @@ bool namecache_fetch(const char *name, *num_names = ipstr_list_parse(value, ip_list); SAFE_FREE(key); - SAFE_FREE(value); + TALLOC_FREE(value); return *num_names > 0; /* true only if some ip has been fetched */ } @@ -294,7 +294,7 @@ bool namecache_status_fetch(const char *keyname, if (!key) return False; - if (!gencache_get(key, NULL, &value, &timeout)) { + if (!gencache_get(key, talloc_tos(), &value, &timeout)) { DEBUG(5, ("namecache_status_fetch: no entry for %s found.\n", key)); SAFE_FREE(key); @@ -306,6 +306,6 @@ bool namecache_status_fetch(const char *keyname, strlcpy(srvname_out, value, 16); SAFE_FREE(key); - SAFE_FREE(value); + TALLOC_FREE(value); return True; } diff --git a/source3/libsmb/trustdom_cache.c b/source3/libsmb/trustdom_cache.c index 81b366a4cc..81d8bf9c7a 100644 --- a/source3/libsmb/trustdom_cache.c +++ b/source3/libsmb/trustdom_cache.c @@ -160,7 +160,7 @@ bool trustdom_cache_fetch(const char* name, struct dom_sid* sid) if (!key) return False; - if (!gencache_get(key, NULL, &value, &timeout)) { + if (!gencache_get(key, talloc_tos(), &value, &timeout)) { DEBUG(5, ("no entry for trusted domain %s found.\n", name)); SAFE_FREE(key); return False; @@ -172,11 +172,11 @@ bool trustdom_cache_fetch(const char* name, struct dom_sid* sid) /* convert sid string representation into struct dom_sid structure */ if(! string_to_sid(sid, value)) { sid = NULL; - SAFE_FREE(value); + TALLOC_FREE(value); return False; } - SAFE_FREE(value); + TALLOC_FREE(value); return True; } @@ -191,7 +191,7 @@ uint32 trustdom_cache_fetch_timestamp( void ) time_t timeout; uint32 timestamp; - if (!gencache_get(TDOMTSKEY, NULL, &value, &timeout)) { + if (!gencache_get(TDOMTSKEY, talloc_tos(), &value, &timeout)) { DEBUG(5, ("no timestamp for trusted domain cache located.\n")); SAFE_FREE(value); return 0; @@ -199,7 +199,7 @@ uint32 trustdom_cache_fetch_timestamp( void ) timestamp = atoi(value); - SAFE_FREE(value); + TALLOC_FREE(value); return timestamp; } -- cgit