static void sim_config_impl_finalize (GObject *gobject) { SimConfig *config = (SimConfig *) gobject; GList *list; list = config->datasources; while (list) { SimConfigDS *ds = (SimConfigDS *) list->data; sim_config_ds_free (ds); list = list->next; } list = config->notifies; while (list) { SimConfigNotify *notify = (SimConfigNotify *) list->data; sim_config_notify_free (notify); list = list->next; } if (config->component_id) g_object_unref (config->component_id); if (config->default_context_id) g_object_unref (config->default_context_id); if (config->default_engine_id) g_object_unref (config->default_engine_id); if (config->log.filename) g_free (config->log.filename); if (config->directive.filename) g_free (config->directive.filename); if (config->reputation.filename) g_free (config->reputation.filename); if (config->server.id) g_object_unref (config->server.id); if (config->server.name) g_free (config->server.name); if (config->server.ip) g_free (config->server.ip); if (config->server.role) sim_role_unref (config->server.role); if (config->notify_prog) g_free (config->notify_prog); if (config->server.HA_ip) g_free (config->server.HA_ip); if (config->smtp.host) g_free (config->smtp.host); if (config->framework.name) g_free (config->framework.name); if (config->framework.host) g_free (config->framework.host); //Forensic Storage if (config->forensic_storage.path) g_free (config->forensic_storage.path); if (config->forensic_storage.sig_type) g_free (config->forensic_storage.sig_type); if (config->forensic_storage.sig_cipher) g_free (config->forensic_storage.sig_cipher); if (config->forensic_storage.enc_type) g_free (config->forensic_storage.enc_type); if (config->forensic_storage.enc_cipher) g_free (config->forensic_storage.enc_cipher); if (config->forensic_storage.key_source) g_free (config->forensic_storage.key_source); if (config->forensic_storage.sig_prv_key_path) g_free (config->forensic_storage.sig_prv_key_path); if (config->forensic_storage.sig_pub_key_path) g_free (config->forensic_storage.sig_pub_key_path); if (config->forensic_storage.enc_prv_key_path) g_free (config->forensic_storage.enc_prv_key_path); if (config->forensic_storage.enc_pass) g_free (config->forensic_storage.enc_pass); if (config->forensic_storage.enc_pub_key_path) g_free (config->forensic_storage.enc_pub_key_path); if (config->forensic_storage.enc_cert_path) g_free (config->forensic_storage.enc_cert_path); if (config->idm.ip) g_free (config->idm.ip); G_OBJECT_CLASS (parent_class)->finalize (gobject); }
static void _sim_event_free (SimEvent *event) { ossim_debug ("%s: Id %s, Device_id %u", __func__, sim_uuid_get_string (event->id), event->device_id); if (event->id) g_object_unref (event->id); if (event->src_ia) g_object_unref (event->src_ia); if (event->dst_ia) g_object_unref (event->dst_ia); if (event->src_net) g_object_unref (event->src_net); if (event->dst_net) g_object_unref (event->dst_net); if (event->src_id) g_object_unref (event->src_id); if (event->dst_id) g_object_unref (event->dst_id); if (event->sensor) g_object_unref (event->sensor); if (event->sensor_id) g_object_unref (event->sensor_id); if (event->device) g_object_unref (event->device); g_free (event->interface); g_free (event->server); if (event->servername) g_free (event->servername); g_free (event->sql_text_fields); g_free (event->value); g_free (event->data); if (event->role) sim_role_unref (event->role); if (event->policy) g_object_unref (event->policy); g_free (event->time_str); if (event->log) g_string_free (event->log, TRUE); g_free (event->alarm_stats); g_free (event->filename); //no needed to check, g_free will just return if "filename" is NULL g_free (event->username); g_free (event->password); g_free (event->userdata1); g_free (event->userdata2); g_free (event->userdata3); g_free (event->userdata4); g_free (event->userdata5); g_free (event->userdata6); g_free (event->userdata7); g_free (event->userdata8); g_free (event->userdata9); g_free (event->rulename); if (event->src_username) g_hash_table_unref (event->src_username); g_free (event->src_username_raw); if (event->dst_username) g_hash_table_unref (event->dst_username); g_free (event->dst_username_raw); g_free (event->src_hostname); g_free (event->dst_hostname); g_free (event->src_mac); g_free (event->dst_mac); g_free (event->str_rep_act_src); if(event->rep_act_src) g_hash_table_unref (event->rep_act_src); g_free (event->str_rep_act_dst); if(event->rep_act_dst) g_hash_table_unref (event->rep_act_dst); g_free (event->buffer); if (event->groupalarmsha1) g_free (event->groupalarmsha1); if (event->binary_data) g_free (event->binary_data); if (event->context) g_object_unref (event->context); if (event->engine) g_object_unref (event->engine); g_slice_free (SimEvent, event); }