]> git.saurik.com Git - redis.git/blobdiff - redis.c
Fixed a bug in HSET, a memory leak, and a theoretical bug in dict.c
[redis.git] / redis.c
diff --git a/redis.c b/redis.c
index 302944de8c4b92e7ff52ee4d26788fdc498e9f75..3f9c4c964915363192d55088663116203a98cc8f 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -5849,7 +5849,7 @@ static void hsetCommand(redisClient *c) {
         tryObjectEncoding(c->argv[2]);
         /* note that c->argv[3] is already encoded, as the latest arg
          * of a bulk command is always integer encoded if possible. */
-        if (dictAdd(o->ptr,c->argv[2],c->argv[3]) == DICT_OK) {
+        if (dictReplace(o->ptr,c->argv[2],c->argv[3])) {
             incrRefCount(c->argv[2]);
         } else {
             update = 1;