krb5 commit: Fix kdb_ldap_create_principal cleanup
Greg Hudson
ghudson at MIT.EDU
Fri Mar 29 11:41:34 EDT 2013
https://github.com/krb5/krb5/commit/49f908733b5ddf491e53c7c84d0cbae263e31eae
commit 49f908733b5ddf491e53c7c84d0cbae263e31eae
Author: Greg Hudson <ghudson at mit.edu>
Date: Thu Mar 28 15:59:07 2013 -0400
Fix kdb_ldap_create_principal cleanup
entry must be initialized before all code which can jump to cleanup.
src/plugins/kdb/ldap/ldap_util/kdb5_ldap_realm.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_realm.c b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_realm.c
index 1050fcd..7494928 100644
--- a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_realm.c
+++ b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_realm.c
@@ -1344,6 +1344,8 @@ kdb_ldap_create_principal(krb5_context context, krb5_principal princ,
krb5_timestamp now;
krb5_actkvno_node actkvno;
+ memset(&entry, 0, sizeof(entry));
+
if ((pblock == NULL) || (context == NULL)) {
retval = EINVAL;
goto cleanup;
@@ -1355,8 +1357,6 @@ kdb_ldap_create_principal(krb5_context context, krb5_principal princ,
goto cleanup;
}
- memset(&entry, 0, sizeof(entry));
-
tl_data = malloc(sizeof(*tl_data));
if (tl_data == NULL) {
retval = ENOMEM;
More information about the cvs-krb5
mailing list