svn commit: lorikeet r331 - in trunk/heimdal/lib/krb5: .

abartlet at samba.org abartlet at samba.org
Sat Jun 4 11:16:41 GMT 2005


Author: abartlet
Date: 2005-06-04 11:16:40 +0000 (Sat, 04 Jun 2005)
New Revision: 331

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=331

Log:
Add a function to free a kerberos logging facility.  Previously we
could only close it.

Andrew Bartlett

Modified:
   trunk/heimdal/lib/krb5/krb5-protos.h
   trunk/heimdal/lib/krb5/log.c


Changeset:
Modified: trunk/heimdal/lib/krb5/krb5-protos.h
===================================================================
--- trunk/heimdal/lib/krb5/krb5-protos.h	2005-06-04 02:02:08 UTC (rev 330)
+++ trunk/heimdal/lib/krb5/krb5-protos.h	2005-06-04 11:16:40 UTC (rev 331)
@@ -1535,6 +1535,11 @@
 	krb5_ticket */*ticket*/);
 
 krb5_error_code KRB5_LIB_FUNCTION
+krb5_freelog (
+	krb5_context /*context*/,
+	krb5_log_facility */*fac*/);
+
+krb5_error_code KRB5_LIB_FUNCTION
 krb5_fwd_tgt_creds (
 	krb5_context /*context*/,
 	krb5_auth_context /*auth_context*/,

Modified: trunk/heimdal/lib/krb5/log.c
===================================================================
--- trunk/heimdal/lib/krb5/log.c	2005-06-04 02:02:08 UTC (rev 330)
+++ trunk/heimdal/lib/krb5/log.c	2005-06-04 11:16:40 UTC (rev 331)
@@ -135,6 +135,16 @@
 }
 
 krb5_error_code KRB5_LIB_FUNCTION
+krb5_freelog(krb5_context context,
+	     krb5_log_facility *fac)
+{
+    krb5_closelog(context, fac);
+    free(fac->program);
+    free(fac);
+    return 0;
+}
+
+krb5_error_code KRB5_LIB_FUNCTION
 krb5_addlog_func(krb5_context context,
 		 krb5_log_facility *fac,
 		 int min,
@@ -367,6 +377,8 @@
     int i;
     for(i = 0; i < fac->len; i++)
 	(*fac->val[i].close)(fac->val[i].data);
+
+    fac->len = 0;
     return 0;
 }
 



More information about the samba-cvs mailing list