From 0ebf0f7338977ff073c065037aa4c1d5e162e127 Mon Sep 17 00:00:00 2001 From: John Sully Date: Fri, 22 Feb 2019 21:32:43 -0500 Subject: [PATCH] Fix EMBSTR corruption --- src/defrag.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/defrag.c b/src/defrag.c index 1db31e824..af12289f3 100644 --- a/src/defrag.c +++ b/src/defrag.c @@ -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) {