From cc8a0f898b0aa881064da23dba23f183b13e3195 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 13 May 2011 11:42:02 +0200 Subject: [PATCH] Fix for DEBUG DIGEST, key may expire on lookup --- src/debug.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/debug.c b/src/debug.c index 16ca27a1..30ae08e6 100644 --- a/src/debug.c +++ b/src/debug.c @@ -101,6 +101,11 @@ void computeDatasetDigest(unsigned char *final) { /* Make sure the key is loaded if VM is active */ o = lookupKeyRead(db,keyobj); + if (o == NULL) { + /* Key expired on lookup? Try the next one. */ + decrRefCount(keyobj); + continue; + } aux = htonl(o->type); mixDigest(digest,&aux,sizeof(aux));