*
* Change the password for the existing principal identified by @a creds.
*
+ * The error code and strings are returned in @a result_code,
+ * @a result_code_string and @a result_string. The caller may pass a
+ * @a result_code_string of NULL if it is not needed, but a valid
+ * @a result_string pointer must be supplied. Use krb5_free_data_contents()
+ * to free @a result_code_string and @a result_string when they are no longer
+ * needed.
+ *
* The possible values of the output @a result_code are:
*
* @li #KRB5_KPASSWD_SUCCESS (0) - success
* performed on the principal name passed in @a change_password_for.
*
* The error code and strings are returned in @a result_code,
- * @a result_code_string and @a result_string.
+ * @a result_code_string and @a result_string. The caller may pass a
+ * @a result_code_string of NULL if it is not needed, but a valid
+ * @a result_string pointer must be supplied. Use krb5_free_data_contents()
+ * to free @a result_code_string and @a result_string when they are no longer
+ * needed.
*
* @sa krb5_set_password_using_ccache()
*
* the credential cache.
*
* The error code and strings are returned in @a result_code,
- * @a result_code_string and @a result_string.
+ * @a result_code_string and @a result_string. The caller may pass a
+ * @a result_code_string of NULL if it is not needed, but a valid
+ * @a result_string pointer must be supplied. Use krb5_free_data_contents()
+ * to free @a result_code_string and @a result_string when they are no longer
+ * needed.
*
* @note If @a change_password_for is set to NULL, the change is performed on
* the default principal in @a ccache. If @a change_password_for is non null,
struct sockaddr_storage remote_addr;
struct serverlist sl = SERVERLIST_INIT;
+ *result_string = empty_data();
+ if (result_code_string != NULL)
+ *result_code_string = empty_data();
+
memset(&chpw_rep, 0, sizeof(krb5_data));
memset( &callback_ctx, 0, sizeof(struct sendto_callback_context));
callback_ctx.context = context;
krb5_creds *credsp;
krb5_error_code code;
+ *result_string = empty_data();
+ if (result_code_string != NULL)
+ *result_code_string = empty_data();
+
/*
** get the proper creds for use with krb5_set_password -
*/