]> git.saurik.com Git - redis.git/commitdiff
A fix for an invalid access when VM is disabled
authorantirez <antirez@gmail.com>
Thu, 4 Mar 2010 15:48:26 +0000 (16:48 +0100)
committerantirez <antirez@gmail.com>
Thu, 4 Mar 2010 15:48:26 +0000 (16:48 +0100)
redis.c

diff --git a/redis.c b/redis.c
index 331aaaa03d7424999ab8156ab9dfa1d3b2d607ca..c6283e498d13337c1c986d5bc5b173da3f386e4b 100644 (file)
--- 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]);