From 7cc3cf9410dedcf242254ff017c28cabb86276c6 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 24 Jan 2003 21:20:31 +0000 Subject: masking an assert error in Tim's wins server checking code; needs a proper fix after I talk to tpot (This used to be commit 607bc0b4fca38640c6b5c730aa4119e2aa9006fc) --- source3/lib/gencache.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source3/lib') 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)); -- cgit