Fix a memory leak in krb5int_rd_chpw_rep in a block of code handling
authorGreg Hudson <ghudson@mit.edu>
Sat, 2 May 2009 04:58:19 +0000 (04:58 +0000)
committerGreg Hudson <ghudson@mit.edu>
Sat, 2 May 2009 04:58:19 +0000 (04:58 +0000)
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

index d0cadb4bb77c939075b66aefdfd60577b604b59b..13adbd6aef4a2bf4b6b27bb123d72349a945f317 100644 (file)
@@ -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);
        }