From ddfaca9d81cdebf4ced1cd65c42983edc052ab57 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 4 Mar 2010 16:48:26 +0100 Subject: [PATCH] A fix for an invalid access when VM is disabled --- redis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis.c b/redis.c index 331aaaa0..c6283e49 100644 --- a/redis.c +++ b/redis.c @@ -3536,7 +3536,7 @@ static void setGenericCommand(redisClient *c, int nx) { * to overwrite the old. So we delete the old key in the database. * This will also make sure that swap pages about the old object * will be marked as free. */ - if (deleteIfSwapped(c->db,c->argv[1])) + if (server.vm_enabled && deleteIfSwapped(c->db,c->argv[1])) incrRefCount(c->argv[1]); dictReplace(c->db->dict,c->argv[1],c->argv[2]); incrRefCount(c->argv[2]); -- 2.47.2