Skip to content

Commit

Permalink
Fix minor leak in kadmind password change dispatch
Browse files Browse the repository at this point in the history
In the unlikely event that kadmind cannot resolve the KDB keytab in
schpw.c:dispatch(), don't leak the error message.  Reported by Bean
Zhang.
  • Loading branch information
greghudson committed Oct 26, 2018
1 parent c4bdb3a commit 597f189
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/kadmin/server/schpw.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,14 @@ dispatch(void *handle, const krb5_fulladdr *local_addr,
krb5_keytab kt = NULL;
kadm5_server_handle_t server_handle = (kadm5_server_handle_t)handle;
krb5_data *response = NULL;
const char *emsg;

ret = krb5_kt_resolve(server_handle->context, "KDB:", &kt);
if (ret != 0) {
emsg = krb5_get_error_message(server_handle->context, ret);
krb5_klog_syslog(LOG_ERR, _("chpw: Couldn't open admin keytab %s"),
krb5_get_error_message(server_handle->context, ret));
emsg);
krb5_free_error_message(server_handle->context, emsg);
goto egress;
}

Expand Down

0 comments on commit 597f189

Please sign in to comment.