void destroy_proto_list(basic_cfg_t *cfg) { void *cookie = NULL; proto_info_t *pi; if (cfg->proto_list == NULL) return; while ((pi = uu_list_teardown(cfg->proto_list, &cookie)) != NULL) destroy_proto_info(cfg, pi); uu_list_destroy(cfg->proto_list); cfg->proto_list = NULL; }
/* * A counterpart to add_proto_list(), this function removes and frees the * scf_value_t's it added to entry 'entry'. */ static void remove_proto_list(scf_transaction_entry_t *entry, uu_list_t *sv_list) { scf_val_el_t *sv_el; void *cookie = NULL; scf_entry_reset(entry); while ((sv_el = uu_list_teardown(sv_list, &cookie)) != NULL) { scf_value_destroy(sv_el->val); free(sv_el); } uu_list_destroy(sv_list); }
/* * Release any memory associated with a changelist. */ void changelist_free(prop_changelist_t *clp) { prop_changenode_t *cn; void *cookie; if (clp->cl_list) { cookie = NULL; while ((cn = uu_list_teardown(clp->cl_list, &cookie)) != NULL) { zfs_close(cn->cn_handle); free(cn); } uu_list_destroy(clp->cl_list); } if (clp->cl_pool) uu_list_pool_destroy(clp->cl_pool); free(clp); }
/* * Tear-down structures created in method_init(). */ void method_fini(void) { if (method_list != NULL) { method_el_t *me; while ((me = uu_list_first(method_list)) != NULL) unregister_method(me); (void) uu_list_destroy(method_list); method_list = NULL; } if (method_pool != NULL) { (void) uu_list_pool_destroy(method_pool); method_pool = NULL; } /* revert file limit */ method_preexec(); }
void destroy_tlx_info(tlx_info_t *tlx) { tlx_conn_ind_t *ci; void *cookie = NULL; if (tlx == NULL) return; free(tlx->dev_name); if (tlx->conn_ind_queue != NULL) { /* free up conn ind queue */ while ((ci = uu_list_teardown(tlx->conn_ind_queue, &cookie)) != NULL) { (void) t_free((char *)ci->call, T_CALL); free(ci); } uu_list_destroy(tlx->conn_ind_queue); } free(tlx->local_addr.buf); free(tlx); }