Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
fe434069
Unverified
Commit
fe434069
authored
Oct 01, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
Oct 01, 2018
Browse files
Merge pull request #5397 from bmerry/fix-bad-zmalloc-size
Fix invalid use of sdsZmallocSize on an embedded string
parents
9ce63869
ecc48369
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/scripting.c
View file @
fe434069
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment