void openpam_clear_chains(pam_chain_t *policy[]) { int i; for (i = 0; i < PAM_NUM_FACILITIES; ++i) { openpam_destroy_chain(policy[i]); policy[i] = NULL; } }
static void openpam_destroy_chain(pam_chain_t *chain) { if (chain == NULL) return; openpam_destroy_chain(chain->next); chain->next = NULL; FREEV(chain->optc, chain->optv); openpam_release_module(chain->module); chain->module = NULL; FREE(chain); }