From 8450d6e24d1ed2a30b63591fe202914e1d3d8c2c Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 24 Jun 2013 19:27:49 +0200 Subject: [PATCH] Move Replication Script Cache initialization in safer place. It should be called just one time at startup and not every time the Lua scripting engine is re-initialized, otherwise memory is leaked. --- src/redis.c | 1 + src/scripting.c | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/redis.c b/src/redis.c index 737d6649..4ba73ab7 100644 --- a/src/redis.c +++ b/src/redis.c @@ -1476,6 +1476,7 @@ void initServer() { server.maxmemory_policy = REDIS_MAXMEMORY_NO_EVICTION; } + replicationScriptCacheInit(); scriptingInit(); slowlogInit(); bioInit(); diff --git a/src/scripting.c b/src/scripting.c index f30956bd..ff94ae16 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -655,10 +655,6 @@ void scriptingInit(void) { * to global variables. */ scriptingEnableGlobalsProtection(lua); - /* Initialize the Replication Script Cache for EVALSHA propagation to - * slaves and AOF. */ - replicationScriptCacheInit(); - server.lua = lua; }