]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix memory leak in SPAKE kdcpreauth module
authorsashan <anedvedicky@gmail.com>
Thu, 26 May 2022 06:51:10 +0000 (08:51 +0200)
committerGreg Hudson <ghudson@mit.edu>
Fri, 4 Nov 2022 16:25:58 +0000 (12:25 -0400)
Commit ff57dc682a27bd205d715f3c0bed84890f2453c4 introduced a memory
leak into verify_response().  reply_key is no longer passed to the
callback and therefore needs to be freed by this function.

[ghudson@mit.edu: rewrote commit message]

(cherry picked from commit 445e1b32767af3041ffd1823996d05ffec6fc9d5)

ticket: 9061
version_fixed: 1.20.1

src/plugins/preauth/spake/spake_kdc.c

index 687cdc9e0aca3521de30dfa8846af66007029ace..1a772d450fb906455af85a4d4a64a699bfab98f1 100644 (file)
@@ -469,6 +469,7 @@ cleanup:
     zapfree(spakeresult.data, spakeresult.length);
     krb5_free_data_contents(context, &thash);
     krb5_free_keyblock(context, k1);
+    krb5_free_keyblock(context, reply_key);
     k5_free_spake_factor(context, factor);
     (*respond)(arg, ret, NULL, NULL, NULL);
 }