static void house_keeping (void) { #ifdef TCB_MEMHASH /* free malloc'd int values on the agent list */ if (conf.list_agents) free_agent_list (); #endif /* REVERSE DNS THREAD */ pthread_mutex_lock (&gdns_thread.mutex); /* kill dns pthread */ active_gdns = 0; free_holder (&holder); gdns_free_queue (); /* free uniqmap */ #if defined(TCB_BTREE) || defined(TCB_MEMHASH) /*for (module = 0; module < TOTAL_MODULES; module++) { */ /*free_db_key (get_storage_metric (module, MTRC_UNIQMAP)); */ /*} */ #endif free_storage (); pthread_mutex_unlock (&gdns_thread.mutex); /* DASHBOARD */ if (dash && !conf.output_html) { free_dashboard (dash); reset_find (); } /* GEOLOCATION */ #ifdef HAVE_LIBGEOIP if (geo_location_data != NULL) GeoIP_delete (geo_location_data); #endif /* LOGGER */ free (logger); /* INVALID REQUESTS */ if (conf.invalid_requests_log) { LOG_DEBUG (("Closing invalid requests log.\n")); invalid_log_close (); } /* CONFIGURATION */ if (conf.debug_log) { LOG_DEBUG (("Bye.\n")); dbg_log_close (); } /* free colors */ free_color_lists (); /* free cmd arguments */ free_cmd_args (); }
static void house_keeping (void) { #if defined(TCB_BTREE) || defined(TCB_MEMHASH) GModule module; #endif #ifndef TCB_BTREE if (conf.list_agents) free_agent_list (); #endif /* REVERSE DNS THREAD */ pthread_mutex_lock (&gdns_thread.mutex); /* kill dns pthread */ active_gdns = 0; free_holder (&holder); gdns_free_queue (); /* free uniqmap */ #if defined(TCB_BTREE) || defined(TCB_MEMHASH) for (module = 0; module < TOTAL_MODULES; module++) { free_db_key (get_storage_metric (module, MTRC_UNIQMAP)); } #endif free_storage (); pthread_mutex_unlock (&gdns_thread.mutex); /* DASHBOARD */ if (dash && !conf.output_html) { free_dashboard (dash); reset_find (); } /* GEOLOCATION */ #ifdef HAVE_LIBGEOIP if (geo_location_data != NULL) GeoIP_delete (geo_location_data); #endif /* LOGGER */ free (logger); /* CONFIGURATION */ if (conf.debug_log) { LOG_DEBUG (("Bye.\n")); dbg_log_close (); } free_cmd_args (); }
static void house_keeping (void) { /* REVERSE DNS THREAD */ pthread_mutex_lock (&gdns_thread.mutex); /* kill dns pthread */ active_gdns = 0; free_holder (&holder); gdns_free_queue (); if (ht_hostnames != NULL) { #ifdef HAVE_LIBTOKYOCABINET tc_db_close (ht_hostnames, DB_HOSTNAMES); #else g_hash_table_destroy (ht_hostnames); #endif } pthread_mutex_unlock (&gdns_thread.mutex); /* DASHBOARD */ if (dash && !conf.output_html) { free_dashboard (dash); reset_find (); } /* GEOLOCATION */ #ifdef HAVE_LIBGEOIP if (geo_location_data != NULL) GeoIP_delete (geo_location_data); #endif /* STORAGE */ free_storage (); /* LOGGER */ free (logger); /* CONFIGURATION */ if (conf.debug_log) { LOG_DEBUG (("Bye.\n")); dbg_log_close (); } free_cmd_args (); }