krb5 commit: Document how to free krb5_cc_get_full_name result
Greg Hudson
ghudson at MIT.EDU
Wed Jun 20 11:14:32 EDT 2012
https://github.com/krb5/krb5/commit/37b09d45192bd9d958d047dbb829d10f892b1fda
commit 37b09d45192bd9d958d047dbb829d10f892b1fda
Author: Greg Hudson <ghudson at mit.edu>
Date: Wed Jun 20 11:14:08 2012 -0400
Document how to free krb5_cc_get_full_name result
Also, in klist, use the appropriate libkrb5 free functions for
krb5_cc_get_full_name and krb5_unparse_name_results. Reported by
Kevin Wasserman.
ticket: 7179
src/clients/klist/klist.c | 4 ++--
src/include/krb5/krb5.hin | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/clients/klist/klist.c b/src/clients/klist/klist.c
index 503a114..9d8f0a8 100644
--- a/src/clients/klist/klist.c
+++ b/src/clients/klist/klist.c
@@ -386,8 +386,8 @@ list_ccache(krb5_ccache cache)
status = 0;
cleanup:
krb5_free_principal(kcontext, princ);
- free(princname);
- free(ccname);
+ krb5_free_unparsed_name(kcontext, princname);
+ krb5_free_string(kcontext, ccname);
return status;
}
diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin
index 4d2864c..de314a0 100644
--- a/src/include/krb5/krb5.hin
+++ b/src/include/krb5/krb5.hin
@@ -2265,6 +2265,8 @@ krb5_cc_get_name(krb5_context context, krb5_ccache cache);
* @param [in] cache Credential cache handle
* @param [out] fullname_out Full name of cache
*
+ * Use krb5_free_string() to free @a fullname_out when it is no longer needed.
+ *
* @version First introduced in 1.10
*/
krb5_error_code KRB5_CALLCONV
More information about the cvs-krb5
mailing list