05.03., 9:00 - 11:00: Due to updates GitLab will be unavailable for some minutes between 09:00 and 11:00.

Commit 1a435282 authored by Alessio Netti's avatar Alessio Netti

libdcdb: fixed a Cassandra-related memory leak on sensor-publish ops

parent d87022f9
......@@ -963,7 +963,6 @@ SCError SensorConfigImpl::getPublicSensorByName(PublicSensor& sensor, const char
const CassValue* opSet = nullptr;
CassIterator *opSetIt = nullptr;
if((opSet=cass_row_get_column_by_name(row, "operations")) && (opSetIt=cass_iterator_from_collection(opSet))) {
CassIterator *opSetIt = cass_iterator_from_collection(opSet);
const char *opString;
size_t opLen;
......@@ -1495,6 +1494,8 @@ SCError SensorConfigImpl::setOperations(std::string publicName, std::set<std::st
rc = cass_future_error_code(future);
if (rc != CASS_OK) {
connection->printError(future);
cass_future_free(future);
cass_collection_free(cassSet);
return SC_UNKNOWNERROR;
}
......@@ -1517,7 +1518,8 @@ SCError SensorConfigImpl::setOperations(std::string publicName, std::set<std::st
else {
error = SC_OK;
}
cass_future_free(future);
cass_statement_free(statement);
cass_prepared_free(prepared);
cass_collection_free(cassSet);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment