Merge pull request #7160 from oranagra/refix-get_decoded_object

hickup, re-fix dictEncObjKeyCompare
This commit is contained in:
Salvatore Sanfilippo 2020-04-28 11:19:28 +02:00 committed by GitHub
commit 4d4c8c8a40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1223,11 +1223,11 @@ int dictEncObjKeyCompare(void *privdata, const void *key1,
* good reasons, because it would incrRefCount() the object, which
* is invalid. So we check to make sure dictFind() works with static
* objects as well. */
if (!sdsEncodedObject(o1)) o1 = getDecodedObject(o1);
if (!sdsEncodedObject(o2)) o2 = getDecodedObject(o2);
if (o1->refcount != OBJ_STATIC_REFCOUNT) o1 = getDecodedObject(o1);
if (o2->refcount != OBJ_STATIC_REFCOUNT) o2 = getDecodedObject(o2);
cmp = dictSdsKeyCompare(privdata,o1->ptr,o2->ptr);
if (o1!=key1) decrRefCount(o1);
if (o2!=key2) decrRefCount(o2);
if (o1->refcount != OBJ_STATIC_REFCOUNT) decrRefCount(o1);
if (o2->refcount != OBJ_STATIC_REFCOUNT) decrRefCount(o2);
return cmp;
}