]> granicus.if.org Git - icinga2/commitdiff
Fix memory leak in RedisWriter::ExecuteQuery
authorGunnar Beutner <gunnar.beutner@icinga.com>
Wed, 22 Mar 2017 11:08:54 +0000 (12:08 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Wed, 29 Mar 2017 08:17:03 +0000 (10:17 +0200)
refs #4991

lib/redis/rediswriter.cpp

index 722bf95db74fc3a53b1fffb7c540f93404573438..64cc471c16b744cfc4d5c8fe7d8f1c138f1c58e5 100644 (file)
@@ -268,6 +268,9 @@ boost::shared_ptr<redisReply> RedisWriter::ExecuteQuery(const std::vector<String
 
        redisReply *reply = reinterpret_cast<redisReply *>(redisCommandArgv(m_Context, query.size(), argv, argvlen));
 
+       delete [] argv;
+       delete [] argvlen;
+
        if (reply->type == REDIS_REPLY_ERROR) {
                Log(LogInformation, "RedisWriter")
                    << "Redis query failed: " << reply->str;