summaryrefslogtreecommitdiffstats
path: root/src/kadmin/v5passwdd
diff options
context:
space:
mode:
Diffstat (limited to 'src/kadmin/v5passwdd')
-rw-r--r--src/kadmin/v5passwdd/kpasswd.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/kadmin/v5passwdd/kpasswd.c b/src/kadmin/v5passwdd/kpasswd.c
index 0254b52075..327c081a34 100644
--- a/src/kadmin/v5passwdd/kpasswd.c
+++ b/src/kadmin/v5passwdd/kpasswd.c
@@ -241,25 +241,30 @@ main(argc, argv)
return(error);
}
+ /*
+ * Initialize Kerberos
+ */
+ kret = krb5_init_context(&kcontext);
+ if (kret) {
+ com_err(argv[0], kret, "while initializing krb5");
+ exit(1);
+ }
+
/* Get space for passwords */
if (
((npassword = (char *) malloc(KRB5_ADM_MAX_PASSWORD_LEN))
== (char *) NULL) ||
((opassword = (char *) malloc(KRB5_ADM_MAX_PASSWORD_LEN))
- == (char *) NULL)) {
+ == (char *) NULL))
+ {
fprintf(stderr, kpwd_no_memory_fmt, argv[0], KRB5_ADM_MAX_PASSWORD_LEN,
kpwd_password_text);
if (npassword)
free(npassword);
+ krb5_free_context(kcontext);
return(ENOMEM);
}
- /*
- * Initialize Kerberos
- */
- krb5_init_context(&kcontext);
- krb5_init_ets(kcontext);
-
/* From now on, all error legs via 'goto cleanup' */
if (name) {