From d43db9daf9b0a24ca3d153eba58faaa1d2965a33 Mon Sep 17 00:00:00 2001 From: John Sully Date: Fri, 8 May 2020 00:15:58 -0400 Subject: [PATCH] Free memory before we enter a script and may not have a chance Former-commit-id: 7a3173c74ca617b4d0f9e852ab580731fa92f3df --- src/scripting.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/scripting.cpp b/src/scripting.cpp index 224b32931..6458d7509 100644 --- a/src/scripting.cpp +++ b/src/scripting.cpp @@ -1472,6 +1472,9 @@ void evalGenericCommand(client *c, int evalsha) { long long initial_server_dirty = g_pserver->dirty; int delhook = 0, err; + if (g_pserver->m_pstorageFactory != nullptr) + freeMemoryIfNeededAndSafe(true); + /* When we replicate whole scripts, we want the same PRNG sequence at * every call so that our PRNG is not affected by external state. */ redisSrand48(0);