Merge pull request #2542 from yossigo/lua_client_buffer_crash

Fix Redis server crash when Lua command exceeds client output buffer limit.
This commit is contained in:
Salvatore Sanfilippo 2015-05-04 12:19:44 +02:00
commit 22d00d80ce

View File

@ -805,7 +805,7 @@ void freeClient(redisClient *c) {
* a context where calling freeClient() is not possible, because the client * a context where calling freeClient() is not possible, because the client
* should be valid for the continuation of the flow of the program. */ * should be valid for the continuation of the flow of the program. */
void freeClientAsync(redisClient *c) { void freeClientAsync(redisClient *c) {
if (c->flags & REDIS_CLOSE_ASAP) return; if (c->flags & REDIS_CLOSE_ASAP || c->flags & REDIS_LUA_CLIENT) return;
c->flags |= REDIS_CLOSE_ASAP; c->flags |= REDIS_CLOSE_ASAP;
listAddNodeTail(server.clients_to_close,c); listAddNodeTail(server.clients_to_close,c);
} }