Browse Source

Free memory from host string in influxDB (#410)

i18n
Xose Pérez 6 years ago
parent
commit
7bed35f0d6
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      code/espurna/influxdb.ino

+ 2
- 0
code/espurna/influxdb.ino View File

@ -53,6 +53,7 @@ template<typename T> bool idbSend(const char * topic, T payload) {
_idb_client.setTimeout(2);
if (!_idb_client.connect(host, port)) {
DEBUG_MSG("[INFLUXDB] Connection failed\n");
free(host);
return false;
}
@ -65,6 +66,7 @@ template<typename T> bool idbSend(const char * topic, T payload) {
getSetting("idbDatabase", INFLUXDB_DATABASE).c_str(),
getSetting("idbUsername", INFLUXDB_USERNAME).c_str(), getSetting("idbPassword", INFLUXDB_PASSWORD).c_str(),
host, port, strlen(data), data);
free(host);
if (_idb_client.printf(request) > 0) {
while (_idb_client.connected() && _idb_client.available() == 0) delay(1);


Loading…
Cancel
Save