Free memory before we enter a script and may not have a chance

Former-commit-id: 7a3173c74ca617b4d0f9e852ab580731fa92f3df
This commit is contained in:
John Sully 2020-05-08 00:15:58 -04:00
parent 81c5af353b
commit d43db9daf9

View File

@ -1472,6 +1472,9 @@ void evalGenericCommand(client *c, int evalsha) {
long long initial_server_dirty = g_pserver->dirty; long long initial_server_dirty = g_pserver->dirty;
int delhook = 0, err; int delhook = 0, err;
if (g_pserver->m_pstorageFactory != nullptr)
freeMemoryIfNeededAndSafe(true);
/* When we replicate whole scripts, we want the same PRNG sequence at /* When we replicate whole scripts, we want the same PRNG sequence at
* every call so that our PRNG is not affected by external state. */ * every call so that our PRNG is not affected by external state. */
redisSrand48(0); redisSrand48(0);