diff options
| author | michael-grunder <michael.grunder@gmail.com> | 2022-11-09 18:20:15 -0800 | 
|---|---|---|
| committer | Michael Grunder <michael.grunder@gmail.com> | 2022-11-09 18:35:59 -0800 | 
| commit | 7583ebb1b271e7cb8e44f8211d02bd719d4a4bd1 (patch) | |
| tree | 5f90a7961ac6b728a6e0c25ce4f0b55c5724cd4b | |
| parent | 2c53dea7f9853090c2bcbc6370e9faf958300703 (diff) | |
| download | hiredict-7583ebb1b271e7cb8e44f8211d02bd719d4a4bd1.tar.xz | |
Make freeing a NULL redisAsyncContext a no op.
This makes our behavior consistent with redisFree and freeReplyObject.
| -rw-r--r-- | async.c | 4 | 
1 files changed, 4 insertions, 0 deletions
| @@ -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); | 
