static void master_delete_child(MASTER_PROC *proc) { MASTER_SERV *serv; /* * Undo the things that master_spawn did. Stop the process if it still * exists, and remove it from the lookup tables. Update the number of * available processes. */ serv = proc->serv; serv->total_proc--; if (proc->avail == MASTER_STAT_AVAIL) master_avail_less(serv, proc); else master_avail_listen(serv); binhash_delete(master_child_table, (void *) &proc->pid, sizeof(proc->pid), (void (*) (void *)) 0); myfree((void *) proc); }
void mypwfree(struct mypasswd * mypwd) { if (mypwd->refcount < 1) msg_panic("mypwfree: refcount %d", mypwd->refcount); /* * See mypwenter() for the reason behind the binhash_locate() test. */ if (--mypwd->refcount == 0) { htable_delete(mypwcache_name, mypwd->pw_name, (void (*) (char *)) 0); if (binhash_locate(mypwcache_uid, (char *) &mypwd->pw_uid, sizeof(mypwd->pw_uid))) binhash_delete(mypwcache_uid, (char *) &mypwd->pw_uid, sizeof(mypwd->pw_uid), (void (*) (char *)) 0); myfree(mypwd->pw_name); myfree(mypwd->pw_passwd); myfree(mypwd->pw_gecos); myfree(mypwd->pw_dir); myfree(mypwd->pw_shell); myfree((char *) mypwd); } }
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); }