From df79822b2bb53677b9156ca724a889cd6ee02d56 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 22 Aug 2019 22:17:13 +0200 Subject: [PATCH] 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 781b275295d07cf9df4240e4c7d6d789a6b4a791) (cherry picked from commit dcdcdd4efeea77237628a63f9ceb3cd5ca5e2eba) --- daemon/redis.c | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/redis.c b/daemon/redis.c index 9026f136d..bbdcc059a 100644 --- a/daemon/redis.c +++ b/daemon/redis.c @@ -677,6 +677,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); }