From 9ea20c99eadea54a7cb4efb51e2f6e06e4187915 Mon Sep 17 00:00:00 2001 From: Pavel Rochnyack Date: Tue, 19 Jun 2018 23:19:34 +0700 Subject: [PATCH] redis plugin: Fix memleak --- src/redis.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/redis.c b/src/redis.c index 23234b83..36f57b09 100644 --- a/src/redis.c +++ b/src/redis.c @@ -316,8 +316,12 @@ static int redis_init(void) /* {{{ */ rn->name = strdup("default"); rn->host = strdup(REDIS_DEF_HOST); - if (rn->name == NULL || rn->host == NULL) + if (rn->name == NULL || rn->host == NULL) { + sfree(rn->name); + sfree(rn->host); + sfree(rn); return ENOMEM; + } return redis_node_add(rn); } /* }}} int redis_init */ -- 2.11.0