Fix EMBSTR corruption

This commit is contained in:
John Sully 2019-02-22 21:32:43 -05:00
parent 0ccceddae0
commit 0ebf0f7338

View File

@ -124,9 +124,7 @@ robj *activeDefragStringOb(robj* ob, long *defragged) {
} else if (ob->encoding==OBJ_ENCODING_EMBSTR) {
/* The sds is embedded in the object allocation, calculate the
* offset and update the pointer in the new allocation. */
long ofs = (intptr_t)ptrFromObj(ob) - (intptr_t)ob;
if ((ret = activeDefragAlloc(ob))) {
ret->m_ptr = (void*)((intptr_t)ret + ofs);
(*defragged)++;
}
} else if (ob->encoding!=OBJ_ENCODING_INT) {