summaryrefslogtreecommitdiff
path: root/async.c
diff options
context:
space:
mode:
Diffstat (limited to 'async.c')
-rw-r--r--async.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/async.c b/async.c
index d7feba3..f82f567 100644
--- a/async.c
+++ b/async.c
@@ -413,7 +413,11 @@ static void __redisAsyncFree(redisAsyncContext *ac) {
* free'ing. To do so, a flag is set on the context which is picked up by
* redisProcessCallbacks(). Otherwise, the context is immediately free'd. */
void redisAsyncFree(redisAsyncContext *ac) {
+ if (ac == NULL)
+ return;
+
redisContext *c = &(ac->c);
+
c->flags |= REDIS_FREEING;
if (!(c->flags & REDIS_IN_CALLBACK))
__redisAsyncFree(ac);