redis plugin: Fix coredump when stopping Collectd with inaccessible Redis server
authorPavel Rochnyack <pavel2000@ngs.ru>
Thu, 23 Aug 2018 07:21:44 +0000 (14:21 +0700)
committerPavel Rochnyack <pavel2000@ngs.ru>
Thu, 23 Aug 2018 07:21:44 +0000 (14:21 +0700)
src/redis.c

index 41442b6..dd4deb1 100644 (file)
@@ -97,7 +97,8 @@ static void redis_node_free(void *arg) {
     rq = next;
   }
 
-  redisFree(rn->redisContext);
+  if (rn->redisContext)
+    redisFree(rn->redisContext);
   sfree(rn->name);
   sfree(rn->host);
   sfree(rn->passwd);