summaryrefslogtreecommitdiff
path: root/async.c
diff options
context:
space:
mode:
authorMeir Shpilraien (Spielrein) <meir@redislabs.com>2021-07-11 21:26:20 +0300
committerGitHub <noreply@github.com>2021-07-11 11:26:20 -0700
commitf5f31ff9b92b6bdf628716449d0d0782ceb7704a (patch)
tree06488aa9aa14564e91a282aa5f83d546c87ee144 /async.c
parent5850a8ecd2fb4ab39d80773e3017f02aff097ec4 (diff)
Added REDIS_NO_AUTO_FREE_REPLIES flag (#962)
When set hiredis will not automatically free replies in an async context, and the replies must be freed instead by the user. Co-authored-by: Michael Grunder <michael.grunder@gmail.com>
Diffstat (limited to 'async.c')
-rw-r--r--async.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/async.c b/async.c
index 29f6924..e37afbd 100644
--- a/async.c
+++ b/async.c
@@ -569,7 +569,9 @@ void redisProcessCallbacks(redisAsyncContext *ac) {
if (cb.fn != NULL) {
__redisRunCallback(ac,&cb,reply);
- c->reader->fn->freeObject(reply);
+ if (!(c->flags & REDIS_NO_AUTO_FREE_REPLIES)){
+ c->reader->fn->freeObject(reply);
+ }
/* Proceed with free'ing when redisAsyncFree() was called. */
if (c->flags & REDIS_FREEING) {