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
c17fc392
Commit
c17fc392
authored
Nov 02, 2016
by
Salvatore Sanfilippo
Committed by
GitHub
Nov 02, 2016
Browse files
Merge pull request #3581 from dvirsky/fix_io_ctx_sizeof
[MODULES] fixed sizeof in allocating io RedisModuleCtx*
parents
9749e96f
ec8fd6e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/module.c
View file @
c17fc392
...
@@ -3000,7 +3000,7 @@ void RM_EmitAOF(RedisModuleIO *io, const char *cmdname, const char *fmt, ...) {
...
@@ -3000,7 +3000,7 @@ void RM_EmitAOF(RedisModuleIO *io, const char *cmdname, const char *fmt, ...) {
RedisModuleCtx
*
RM_GetContextFromIO
(
RedisModuleIO
*
io
)
{
RedisModuleCtx
*
RM_GetContextFromIO
(
RedisModuleIO
*
io
)
{
if
(
io
->
ctx
)
return
io
->
ctx
;
/* Can't have more than one... */
if
(
io
->
ctx
)
return
io
->
ctx
;
/* Can't have more than one... */
RedisModuleCtx
ctxtemplate
=
REDISMODULE_CTX_INIT
;
RedisModuleCtx
ctxtemplate
=
REDISMODULE_CTX_INIT
;
io
->
ctx
=
zmalloc
(
sizeof
(
*
io
));
io
->
ctx
=
zmalloc
(
sizeof
(
RedisModuleCtx
));
*
(
io
->
ctx
)
=
ctxtemplate
;
*
(
io
->
ctx
)
=
ctxtemplate
;
io
->
ctx
->
module
=
io
->
type
->
module
;
io
->
ctx
->
module
=
io
->
type
->
module
;
io
->
ctx
->
client
=
NULL
;
io
->
ctx
->
client
=
NULL
;
...
...
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