summaryrefslogtreecommitdiff
path: root/source3/lib/gencache.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/gencache.c')
-rw-r--r--source3/lib/gencache.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c
index 871d1d1d80..dc5f32d66e 100644
--- a/source3/lib/gencache.c
+++ b/source3/lib/gencache.c
@@ -212,6 +212,15 @@ BOOL gencache_get(const char *keystr, char **valstr, time_t *timeout)
"timeout = %s", t > time(NULL) ? "valid" :
"expired", keystr, endptr+1, ctime(&t)));
+ if (t <= time(NULL)) {
+
+ /* We're expired, delete the entry */
+ tdb_delete(cache, keybuf);
+
+ SAFE_FREE(databuf.dptr);
+ return False;
+ }
+
if (valstr) {
*valstr = SMB_STRDUP(endptr+1);
if (*valstr == NULL) {
@@ -227,7 +236,7 @@ BOOL gencache_get(const char *keystr, char **valstr, time_t *timeout)
*timeout = t;
}
- return t > time(NULL);
+ return True;
}