Merge pull request #5397 from bmerry/fix-bad-zmalloc-size

Fix invalid use of sdsZmallocSize on an embedded string
This commit is contained in:
Salvatore Sanfilippo 2018-10-01 13:30:42 +02:00 committed by GitHub
commit fe43406929
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1221,7 +1221,7 @@ sds luaCreateFunction(client *c, lua_State *lua, robj *body) {
* EVALSHA commands as EVAL using the original script. */ * EVALSHA commands as EVAL using the original script. */
int retval = dictAdd(server.lua_scripts,sha,body); int retval = dictAdd(server.lua_scripts,sha,body);
serverAssertWithInfo(c ? c : server.lua_client,NULL,retval == DICT_OK); serverAssertWithInfo(c ? c : server.lua_client,NULL,retval == DICT_OK);
server.lua_scripts_mem += sdsZmallocSize(sha) + sdsZmallocSize(body->ptr); server.lua_scripts_mem += sdsZmallocSize(sha) + getStringObjectSdsUsedMemory(body);
incrRefCount(body); incrRefCount(body);
return sha; return sha;
} }