summaryrefslogtreecommitdiffstats
path: root/source/lib/gencache.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-01-24 21:20:31 +0000
committerGerald Carter <jerry@samba.org>2003-01-24 21:20:31 +0000
commit607bc0b4fca38640c6b5c730aa4119e2aa9006fc (patch)
tree908ccf7d51e83b594835247f0773b5b4fbcca35d /source/lib/gencache.c
parentefd52f6ca7784a3edfc0371b5ff2054ad9704ab7 (diff)
downloadsamba-607bc0b4fca38640c6b5c730aa4119e2aa9006fc.tar.gz
samba-607bc0b4fca38640c6b5c730aa4119e2aa9006fc.tar.xz
samba-607bc0b4fca38640c6b5c730aa4119e2aa9006fc.zip
masking an assert error in Tim's wins server checking code; needs a proper fix after I talk to tpot
Diffstat (limited to 'source/lib/gencache.c')
-rw-r--r--source/lib/gencache.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/lib/gencache.c b/source/lib/gencache.c
index d0748456f9c..3ff67b9918c 100644
--- a/source/lib/gencache.c
+++ b/source/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));