From 6cfaeecbbac3f2420b724cd8e62d1ea98288bc05 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Sat, 2 May 2009 04:58:19 +0000 Subject: [PATCH] Fix a memory leak in krb5int_rd_chpw_rep in a block of code handling buggy MS KDC behavior. It's not entirely clear what should happen in the case where memory was leaked (error packet received containing e_data) so pick a conservative option. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22303 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/chpw.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/krb/chpw.c b/src/lib/krb5/krb/chpw.c index d0cadb4bb..13adbd6ae 100644 --- a/src/lib/krb5/krb/chpw.c +++ b/src/lib/krb5/krb/chpw.c @@ -110,11 +110,12 @@ krb5int_rd_chpw_rep(krb5_context context, krb5_auth_context auth_context, if ((ret = krb5_rd_error(context, packet, &krberror))) return(ret); - if (krberror->e_data.data == NULL) { + if (krberror->e_data.data == NULL) ret = ERROR_TABLE_BASE_krb5 + (krb5_error_code) krberror->error; - krb5_free_error(context, krberror); - return (ret); - } + else + ret = KRB5KRB_AP_ERR_MODIFIED; + krb5_free_error(context, krberror); + return(ret); } else { return(KRB5KRB_AP_ERR_MODIFIED); } -- 2.26.2