mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
Merge pull request #3581 from dvirsky/fix_io_ctx_sizeof
[MODULES] fixed sizeof in allocating io RedisModuleCtx*
This commit is contained in:
commit
c17fc39243
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user