Free the context after the user function was called. */
| 666 | |
| 667 | /* Free the context after the user function was called. */ |
| 668 | void moduleFreeContext(RedisModuleCtx *ctx) { |
| 669 | moduleHandlePropagationAfterCommandCallback(ctx); |
| 670 | autoMemoryCollect(ctx); |
| 671 | poolAllocRelease(ctx); |
| 672 | if (ctx->postponed_arrays) { |
| 673 | zfree(ctx->postponed_arrays); |
| 674 | ctx->postponed_arrays_count = 0; |
| 675 | serverLog(LL_WARNING, |
| 676 | "API misuse detected in module %s: " |
| 677 | "RedisModule_ReplyWithArray(REDISMODULE_POSTPONED_ARRAY_LEN) " |
| 678 | "not matched by the same number of RedisModule_SetReplyArrayLen() " |
| 679 | "calls.", |
| 680 | ctx->module->name); |
| 681 | } |
| 682 | if (ctx->flags & REDISMODULE_CTX_THREAD_SAFE) freeClient(ctx->client); |
| 683 | } |
| 684 | |
| 685 | /* This Redis command binds the normal Redis command invocation with commands |
| 686 | * exported by modules. */ |
no test coverage detected