From 9cec9db7941c3058d83ad94b90883ca4cdecc5a3 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Thu, 16 Jun 2016 10:33:15 -0300 Subject: [PATCH] Fix memory leak in the method toJSON from Transaction class --- src/transaction.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/transaction.cc b/src/transaction.cc index c296755c..9b3416da 100644 --- a/src/transaction.cc +++ b/src/transaction.cc @@ -1290,6 +1290,7 @@ std::string Transaction::toOldAuditLogFormat(int parts, for (auto h : l) { audit_log << h->m_key.c_str() << ": "; audit_log << h->m_value.c_str() << std::endl; + delete h; } } if (parts & audit_log::AuditLog::CAuditLogPart) { @@ -1312,6 +1313,7 @@ std::string Transaction::toOldAuditLogFormat(int parts, for (auto h : l) { audit_log << h->m_key.c_str() << ": "; audit_log << h->m_value.c_str() << std::endl; + delete h; } } if (parts & audit_log::AuditLog::GAuditLogPart) {