fix memory leak

This commit is contained in:
CJ Cobb
2021-03-26 12:55:07 -04:00
parent 58509093ac
commit 9e1bc896e7

View File

@@ -282,14 +282,14 @@ public:
BOOST_LOG_TRIVIAL(error) << __func__ << " : " << ss.str(); BOOST_LOG_TRIVIAL(error) << __func__ << " : " << ss.str();
throw std::runtime_error(ss.str()); throw std::runtime_error(ss.str());
} }
cass_tuple_free(tuple);
curBindingIndex_++; curBindingIndex_++;
} }
CassandraStatement() ~CassandraStatement()
{ {
if (statement_) if (statement_)
cass_statement_free(statement_); cass_statement_free(statement_);
BOOST_LOG_TRIVIAL(info) << __func__;
} }
}; };
@@ -481,6 +481,8 @@ public:
{ {
if (result_ != nullptr) if (result_ != nullptr)
cass_result_free(result_); cass_result_free(result_);
if (iter_ != nullptr)
cass_iterator_free(iter_);
} }
}; };
inline bool inline bool