Fixed 2 memory leaks

This should be the root cause of #766 and #796

This patch will be applied to v1.2.x , v1.3.0 and v1.3.1
pull/827/head
René Cannaò 10 years ago
parent 9c1640ca60
commit e5531843ef

@ -1171,6 +1171,7 @@ void MySQL_HostGroups_Manager::read_only_action(char *hostname, int port, int re
// num_rows=resultset->rows_count;
// }
delete resultset;
if (admindb==NULL) { // we initialize admindb only if needed
admindb=new SQLite3DB();
admindb->open((char *)"file:mem_admindb?mode=memory&cache=shared", SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX);

@ -1198,6 +1198,13 @@ __end_monitor_ping_loop:
}
free(buff);
}
while (i) { // now free all the addresses/ports
i--;
free(addresses[i]);
free(ports[i]);
}
free(addresses);
free(ports);
}
__sleep_monitor_ping_loop:

Loading…
Cancel
Save