/* * Free an ARCHIVE_MATCH object. */ int archive_match_free(struct archive *_a) { struct archive_match *a; if (_a == NULL) return (ARCHIVE_OK); archive_check_magic(_a, ARCHIVE_MATCH_MAGIC, ARCHIVE_STATE_ANY | ARCHIVE_STATE_FATAL, "archive_match_free"); a = (struct archive_match *)_a; match_list_free(&(a->inclusions)); match_list_free(&(a->exclusions)); entry_list_free(&(a->exclusion_entry_list)); free(a->inclusion_uids.ids); free(a->inclusion_gids.ids); match_list_free(&(a->inclusion_unames)); match_list_free(&(a->inclusion_gnames)); free(a); return (ARCHIVE_OK); }
static void dict_ldap_close(DICT *dict) { char *myname = "dict_ldap_close"; DICT_LDAP *dict_ldap = (DICT_LDAP *) dict; LDAP_CONN *conn = DICT_LDAP_CONN(dict_ldap); BINHASH_INFO *ht = dict_ldap->ht; if (--conn->conn_refcount == 0) { if (conn->conn_ld) { if (msg_verbose) msg_info("%s: Closed connection handle for LDAP source %s", myname, dict_ldap->ldapsource); ldap_unbind(conn->conn_ld); } binhash_delete(conn_hash, ht->key, ht->key_len, myfree); } cfg_parser_free(dict_ldap->parser); myfree(dict_ldap->ldapsource); myfree(dict_ldap->server_host); myfree(dict_ldap->search_base); if (dict_ldap->domain) match_list_free(dict_ldap->domain); myfree(dict_ldap->query_filter); if (dict_ldap->result_filter) myfree(dict_ldap->result_filter); argv_free(dict_ldap->result_attributes); myfree(dict_ldap->bind_dn); myfree(dict_ldap->bind_pw); #ifdef LDAP_API_FEATURE_X_OPENLDAP myfree(dict_ldap->tls_ca_cert_file); myfree(dict_ldap->tls_ca_cert_dir); myfree(dict_ldap->tls_cert); myfree(dict_ldap->tls_key); myfree(dict_ldap->tls_random_file); myfree(dict_ldap->tls_cipher_suite); #endif dict_free(dict); }