mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
Fix invalid use of sdsZmallocSize on an embedded string
sdsZmallocSize assumes a dynamically allocated SDS. When given a string object created by createEmbeddedStringObject, it calls zmalloc_size on a pointer that isn't the one returned by zmalloc
This commit is contained in:
parent
1d6711a764
commit
ecc48369ce
@ -1221,7 +1221,7 @@ sds luaCreateFunction(client *c, lua_State *lua, robj *body) {
|
||||
* EVALSHA commands as EVAL using the original script. */
|
||||
int retval = dictAdd(server.lua_scripts,sha,body);
|
||||
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);
|
||||
return sha;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user