diff options
-rw-r--r-- | source3/lib/gencache.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c index d0748456f9..3ff67b9918 100644 --- a/source3/lib/gencache.c +++ b/source3/lib/gencache.c @@ -233,7 +233,9 @@ BOOL gencache_get(const char *keystr, char **valstr, time_t *timeout) TDB_DATA keybuf, databuf; /* fail completely if get null pointers passed */ +#if 0 /* JERRY */ SMB_ASSERT(keystr && valstr && timeout); +#endif if (!gencache_init()) return False; @@ -242,6 +244,15 @@ BOOL gencache_get(const char *keystr, char **valstr, time_t *timeout) keybuf.dsize = strlen(keystr); databuf = tdb_fetch(cache, keybuf); + /* special case for tpot */ + if ( !valstr && !timeout ) { + BOOL result = False; + + result = (databuf.dptr == NULL); + SAFE_FREE(databuf.dptr); + return result; + } + if (databuf.dptr && databuf.dsize > TIMEOUT_LEN) { char* entry_buf = strndup(databuf.dptr, databuf.dsize); *valstr = (char*)malloc(sizeof(char) * (databuf.dsize - TIMEOUT_LEN)); |