From d4a2ccd50bfdd41222441da584bd7bcdde1d4f05 Mon Sep 17 00:00:00 2001 From: VivekSainiEQ Date: Tue, 24 Nov 2020 21:04:32 +0000 Subject: [PATCH] Added NULL check to function objFromAllocPtr, now NULL input will map to NULL output even if active replica is enabled Former-commit-id: b67db7c2d5396892cc0c91c3c822a5b9a547badf --- src/object.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/object.cpp b/src/object.cpp index 35b0ae398..733062ee8 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -1528,7 +1528,7 @@ void *allocPtrFromObj(robj_roptr o) { } robj *objFromAllocPtr(void *pv) { - if (g_pserver->fActiveReplica) { + if (pv && g_pserver->fActiveReplica) { return reinterpret_cast(reinterpret_cast(pv)+1); } return reinterpret_cast(pv);