summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-09-09 21:40:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:51:19 -0500
commiteab60e2bb13e0197f3771ab6d60da48a72fb311d (patch)
treed41ab153c08eb26d86f7c36c01cecde7a5ba5878 /source3/libsmb
parentcfefd8fd789b6512cad418a791c274faf54f11da (diff)
downloadsamba-eab60e2bb13e0197f3771ab6d60da48a72fb311d.tar.gz
samba-eab60e2bb13e0197f3771ab6d60da48a72fb311d.tar.bz2
samba-eab60e2bb13e0197f3771ab6d60da48a72fb311d.zip
r18312: Change gencache_get slightly: Delete expired keys, and only strdup the value
if a valid entry was found. The newer calls got the latter one wrong, change the older calls. Volker (This used to be commit 554e68887bc84510690226c9b07a872e7a282abe)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/namecache.c4
-rw-r--r--source3/libsmb/trustdom_cache.c1
2 files changed, 0 insertions, 5 deletions
diff --git a/source3/libsmb/namecache.c b/source3/libsmb/namecache.c
index afbd807198..bd4b3caeb7 100644
--- a/source3/libsmb/namecache.c
+++ b/source3/libsmb/namecache.c
@@ -201,9 +201,7 @@ BOOL namecache_fetch(const char *name, int name_type, struct ip_service **ip_lis
if (!gencache_get(key, &value, &timeout)) {
DEBUG(5, ("no entry for %s#%02X found.\n", name, name_type));
- gencache_del(key);
SAFE_FREE(key);
- SAFE_FREE(value);
return False;
} else {
DEBUG(5, ("name %s#%02X found.\n", name, name_type));
@@ -314,9 +312,7 @@ BOOL namecache_status_fetch(const char *keyname, int keyname_type,
if (!gencache_get(key, &value, &timeout)) {
DEBUG(5, ("namecache_status_fetch: no entry for %s found.\n", key));
- gencache_del(key);
SAFE_FREE(key);
- SAFE_FREE(value);
return False;
} else {
DEBUG(5, ("namecache_status_fetch: key %s -> %s\n", key, value ));
diff --git a/source3/libsmb/trustdom_cache.c b/source3/libsmb/trustdom_cache.c
index 8c5fb4d907..fa35f8d423 100644
--- a/source3/libsmb/trustdom_cache.c
+++ b/source3/libsmb/trustdom_cache.c
@@ -183,7 +183,6 @@ BOOL trustdom_cache_fetch(const char* name, DOM_SID* sid)
if (!gencache_get(key, &value, &timeout)) {
DEBUG(5, ("no entry for trusted domain %s found.\n", name));
SAFE_FREE(key);
- SAFE_FREE(value);
return False;
} else {
SAFE_FREE(key);