svn rev #24179: trunk/src/lib/kadm5/clnt/

ghudson@MIT.EDU ghudson at MIT.EDU
Thu Jul 8 19:51:24 EDT 2010


http://src.mit.edu/fisheye/changelog/krb5/?cs=24179
Commit By: ghudson
Log Message:
Fix a memory leak in libkadm5clnt's get_init_creds().



Changed Files:
U   trunk/src/lib/kadm5/clnt/client_init.c
Modified: trunk/src/lib/kadm5/clnt/client_init.c
===================================================================
--- trunk/src/lib/kadm5/clnt/client_init.c	2010-07-08 23:34:35 UTC (rev 24178)
+++ trunk/src/lib/kadm5/clnt/client_init.c	2010-07-08 23:51:24 UTC (rev 24179)
@@ -391,12 +391,10 @@
                unsigned int full_svcname_len)
 {
     kadm5_ret_t code;
-    krb5_principal client;
-    krb5_ccache ccache;
+    krb5_principal client = NULL;
+    krb5_ccache ccache = NULL;
     char svcname[BUFSIZ];
 
-    client = NULL;
-    ccache = NULL;
     /* NULL svcname means use host-based. */
     if (svcname_in == NULL) {
         code = kadm5_get_admin_service_name(handle->context,
@@ -463,6 +461,7 @@
         code = KADM5_SECURE_PRINC_MISSING;
 
 error:
+    krb5_free_principal(handle->context, client);
     if (ccache != NULL && init_type != INIT_CREDS)
         krb5_cc_close(handle->context, ccache);
     return code;




More information about the cvs-krb5 mailing list