diff options
Diffstat (limited to 'source/lib/gencache.c')
-rw-r--r-- | source/lib/gencache.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/source/lib/gencache.c b/source/lib/gencache.c index fd44616270c..6725ed4c120 100644 --- a/source/lib/gencache.c +++ b/source/lib/gencache.c @@ -268,7 +268,7 @@ BOOL gencache_get(const char *keystr, char **valstr, time_t *timeout) SAFE_FREE(entry_buf); DEBUG(10, ("Returning %s cache entry: key = %s, value = %s, " - "timeout = %s\n", t > time(NULL) ? "valid" : + "timeout = %s", t > time(NULL) ? "valid" : "expired", keystr, v, ctime(&t))); if (valstr) @@ -281,20 +281,18 @@ BOOL gencache_get(const char *keystr, char **valstr, time_t *timeout) return t > time(NULL); - } else { - SAFE_FREE(databuf.dptr); + } - if (valstr) - *valstr = NULL; + SAFE_FREE(databuf.dptr); - if (timeout) - timeout = NULL; + if (valstr) + *valstr = NULL; + if (timeout) + timeout = NULL; - DEBUG(10, ("Cache entry with key = %s couldn't be found\n", - keystr)); + DEBUG(10, ("Cache entry with key = %s couldn't be found\n", keystr)); - return False; - } + return False; } @@ -374,7 +372,7 @@ int gencache_lock_entry( const char *key ) if (!gencache_init()) return -1; - return tdb_lock_bystring(cache, key, 0); + return tdb_lock_bystring(cache, key); } /******************************************************************** |