]> git.saurik.com Git - redis.git/blobdiff - redis.c
include solaris fixes in sha1.c
[redis.git] / redis.c
diff --git a/redis.c b/redis.c
index f2fbbdd53490303fd70e4fce47d8e36d94df1c89..76682d827672fe1feaa18e48b5b9f74750b5002e 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -2927,8 +2927,8 @@ static robj *createStringObjectFromLongLong(long long value) {
         incrRefCount(shared.integers[value]);
         o = shared.integers[value];
     } else {
-        o = createObject(REDIS_STRING, NULL);
         if (value >= LONG_MIN && value <= LONG_MAX) {
+            o = createObject(REDIS_STRING, NULL);
             o->encoding = REDIS_ENCODING_INT;
             o->ptr = (void*)((long)value);
         } else {