From 38062464a09868ff579b3c3c0b43fcd550ea3c61 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Mon, 23 Mar 2009 08:12:37 -0400 Subject: gssd: free buffer allocated by gssd_k5_err_msg There's no way for the caller of gssd_k5_err_msg to know whether to free the string it returns. It can call krb5_get_error_message which returns a string that must be freed via krb5_free_error_string. The other ways that it can return a string require that the memory not be freed. Deal with this by copying the string to a new buffer in all cases. Then we can properly free the string allocated by krb5_get_error_message. Signed-off-by: Jeff Layton Signed-off-by: Steve Dickson --- utils/gssd/krb5_util.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'utils/gssd/krb5_util.h') diff --git a/utils/gssd/krb5_util.h b/utils/gssd/krb5_util.h index 7d808f5..3d39300 100644 --- a/utils/gssd/krb5_util.h +++ b/utils/gssd/krb5_util.h @@ -31,8 +31,7 @@ void gssd_setup_krb5_machine_gss_ccache(char *servername); void gssd_destroy_krb5_machine_creds(void); int gssd_refresh_krb5_machine_credential(char *hostname, struct gssd_k5_kt_princ *ple); -const char * -gssd_k5_err_msg(krb5_context context, krb5_error_code code); +char *gssd_k5_err_msg(krb5_context context, krb5_error_code code); void gssd_k5_get_default_realm(char **def_realm); #ifdef HAVE_SET_ALLOWABLE_ENCTYPES -- cgit