[PC-BSD Commits] r18027 - pcbsd/current/src-sh/pc-adctl/ldap

svn at pcbsd.org svn at pcbsd.org
Tue Jul 31 22:51:09 PDT 2012


Author: johnh
Date: 2012-08-01 05:51:09 +0000 (Wed, 01 Aug 2012)
New Revision: 18027

Modified:
   pcbsd/current/src-sh/pc-adctl/ldap/ldapconf.c
Log:
nearly working free routine



Modified: pcbsd/current/src-sh/pc-adctl/ldap/ldapconf.c
===================================================================
--- pcbsd/current/src-sh/pc-adctl/ldap/ldapconf.c	2012-08-01 05:39:03 UTC (rev 18026)
+++ pcbsd/current/src-sh/pc-adctl/ldap/ldapconf.c	2012-08-01 05:51:09 UTC (rev 18027)
@@ -504,29 +504,95 @@
 static void
 ldap_conf_free(void)
 {
-#if 0
 	struct ldap_entry *le, *letmp;
 
 	TAILQ_FOREACH_SAFE(le, &ldapconf, entries, letmp) {
 		TAILQ_REMOVE(&ldapconf, le, entries);
 
 		switch (le->type) {
-			case LDAP_ENTRY_NULL:
+
+			case LDAP_ENTRY_URI_LIST: {
+				struct ldap_uri *lu, *lutmp;
+				struct ldap_uri_list *lul = le->entry;
+
+				TAILQ_FOREACH_SAFE(lu, lul, entries, lutmp) {
+					TAILQ_REMOVE(lul, lu, entries);
+					xfree(&lu->uri);
+					xfree(&lu);
+				}
+
 				break;
+			}
 
-			case LDAP_ENTRY_PAIR:
-				xfree(&le->lep_name);
-				xfree(&le->lep_value);
+			case LDAP_ENTRY_HOST_LIST: {
+				struct ldap_host *lh, *lhtmp;
+				struct ldap_host_list *lhl = le->entry;
+
+				TAILQ_FOREACH_SAFE(lh, lhl, entries, lhtmp) {
+					TAILQ_REMOVE(lhl, lh, entries);
+					xfree(&lh->host);
+					xfree(&lh);
+				}
+
 				break;
+			}
 
+			case LDAP_ENTRY_SASL_SECPROPS_LIST:
+				break;
+
 			case LDAP_ENTRY_COMMENT:
-				xfree(&le->lec_text);
 				break;
+
+			case BASE:
+				xfree(&((struct ldap_base *)le->entry)->base);
+				break;
+			case BINDDN:
+				xfree(&((struct ldap_binddn *)le->entry)->dn);
+				break;
+
+			case SASL_MECH:
+				xfree(&((struct sasl_mech *)le->entry)->mechanism);
+				break;
+			case SASL_REALM:
+				xfree(&((struct sasl_realm *)le->entry)->realm);
+				break;
+			case SASL_AUTHCID:
+				xfree(&((struct sasl_authcid *)le->entry)->authcid);
+				break;
+			case SASL_AUTHZID:
+				xfree(&((struct sasl_authzid *)le->entry)->authzid);
+				break;
+			case SASL_SECPROPS: {
+				/* XXX get back to this later XXX */
+				break;
+			}
+
+			case TLS_CACERT:
+				xfree(&((struct tls_cacert *)le->entry)->filename);
+				break;
+			case TLS_CACERTDIR:
+				xfree(&((struct tls_cacertdir *)le->entry)->path);
+				break;
+			case TLS_CERT:
+				xfree(&((struct tls_cert *)le->entry)->filename);
+				break;
+			case TLS_KEY:
+				xfree(&((struct tls_key *)le->entry)->filename);
+				break;
+			case TLS_CIPHER_SUITE:
+				xfree(&((struct tls_cipher_suite *)le->entry)->cipher_suite_spec);
+				break;
+			case TLS_RANDFILE:
+				xfree(&((struct tls_randfile *)le->entry)->filename);
+				break;
+			case TLS_CRLFILE:
+				xfree(&((struct tls_crlfile *)le->entry)->filename);
+				break;
 		}
 
+		xfree(&le->entry);
 		xfree(&le);
 	}
-#endif
 }
 
 static void
@@ -603,9 +669,7 @@
 	do_modifications();
 */
 	write_ldap_conf();
-/*
 	ldap_conf_free();
-*/
 
 	xfree(&outfile);
 	xfree(&infile);



More information about the Commits mailing list