From: Ben Kaduk Date: Wed, 19 Nov 2014 17:09:55 +0000 (-0500) Subject: Remove some dead code X-Git-Tag: krb5-1.14-alpha1~191 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb0827e065763821ed1c6c205f15189b1c70bc2a;p=thirdparty%2Fkrb5.git Remove some dead code The secretkey variable is initialized to NULL and compared against NULL, but never actually set to anything after initialization. Remove the variable and all code that would have executed if it was non-NULL. --- diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.c index b562970333..6a06f558c8 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.c @@ -237,7 +237,6 @@ krb5_ldap_delete_principal(krb5_context context, int j=0, ptype=0, pcount=0, attrsetmask=0; krb5_error_code st=0; krb5_boolean singleentry=FALSE; - KEY *secretkey=NULL; kdb5_dal_handle *dal_handle=NULL; krb5_ldap_context *ldap_context=NULL; krb5_ldap_server_handle *ldap_server_handle=NULL; @@ -283,13 +282,7 @@ krb5_ldap_delete_principal(krb5_context context, goto cleanup; singleentry = (pcount == 1) ? TRUE: FALSE; - if (singleentry == FALSE) { - if (secretkey != NULL) { - if ((st=krb5_add_ber_mem_ldap_mod(&mods, "krbprincipalkey", LDAP_MOD_DELETE | LDAP_MOD_BVALUES, - secretkey->keys)) != 0) - goto cleanup; - } - } else { + if (singleentry == TRUE) { /* * If the Kerberos user principal to be deleted happens to be the last one associated * with the directory user object, then it is time to delete the other kerberos @@ -343,17 +336,6 @@ cleanup: if (DN) free (DN); - if (secretkey != NULL) { - int i=0; - while (i < secretkey->nkey) { - free (secretkey->keys[i]->bv_val); - free (secretkey->keys[i]); - ++i; - } - free (secretkey->keys); - free (secretkey); - } - krb5_ldap_free_principal(context, entry); ldap_mods_free(mods, 1);