From 21815828bf2c10b8cdbd5bb9d45d27c4f501d762 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 27 Jun 2008 01:26:08 +0000 Subject: [PATCH] fix free of automatic storage Fix a possible free of automatic storage that can happen on an (unlikely) encoding failure. ticket: new target_version: 1.6.4 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20480 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/rd_safe.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/krb/rd_safe.c b/src/lib/krb5/krb/rd_safe.c index 3eae17269..021fd803e 100644 --- a/src/lib/krb5/krb/rd_safe.c +++ b/src/lib/krb5/krb/rd_safe.c @@ -1,7 +1,7 @@ /* * lib/krb5/krb/rd_safe.c * - * Copyright 1990,1991,2007 by the Massachusetts Institute of Technology. + * Copyright 1990,1991,2007,2008 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may @@ -116,11 +116,11 @@ krb5_rd_safe_basic(krb5_context context, const krb5_data *inbuf, message->checksum = &our_cksum; - if ((retval = encode_krb5_safe_with_body(message, &safe_body, &scratch))) + retval = encode_krb5_safe_with_body(message, &safe_body, &scratch); + message->checksum = his_cksum; + if (retval) goto cleanup; - message->checksum = his_cksum; - retval = krb5_c_verify_checksum(context, keyblock, KRB5_KEYUSAGE_KRB_SAFE_CKSUM, scratch, his_cksum, &valid); -- 2.26.2