Browse Source

TT#65100 Fix double free for redis context on closure

We need to set the redis context to NULL after freeing it, otherwise
other code will try to free it again, which will make the program
abort when exiting.

Change-Id: Id634075344351eb1c924c59739b72bbf57de3c89
(cherry picked from commit 781b275295)
(cherry picked from commit 9d320ab400)
changes/50/32650/1
Guillem Jover 6 years ago
parent
commit
40c8c48327
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      daemon/redis.c

+ 1
- 0
daemon/redis.c View File

@ -672,6 +672,7 @@ err:
static void redis_close(struct redis *r) {
if (r->ctx)
redisFree(r->ctx);
r->ctx = NULL;
mutex_destroy(&r->lock);
g_slice_free1(sizeof(*r), r);
}


Loading…
Cancel
Save