krb5 commit: Fix free of auth context memory replay cache

Greg Hudson <[email protected]>
Newsgroups gmane.comp.encryption.kerberos.cvs
Message-ID <[email protected]>
https://github.com/krb5/krb5/commit/9eeb42a2684ef1914f1dbd6c3f3835648e17f157
commit 9eeb42a2684ef1914f1dbd6c3f3835648e17f157
Author: Greg Hudson <[email protected]>
Date:   Tue Mar 19 11:22:08 2019 -0400

    Fix free of auth context memory replay cache
    
    Also fix a memory leak in t_memrcache.c.
    
    ticket: 8785

 src/lib/krb5/krb/auth_con.c       |    2 +-
 src/lib/krb5/rcache/t_memrcache.c |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/lib/krb5/krb/auth_con.c b/src/lib/krb5/krb/auth_con.c
index a8a97eb..dfc1110 100644
--- a/src/lib/krb5/krb/auth_con.c
+++ b/src/lib/krb5/krb/auth_con.c
@@ -77,8 +77,8 @@ krb5_auth_con_free(krb5_context context, krb5_auth_context auth_context)
         free(auth_context->permitted_etypes);
     if (auth_context->ad_context)
         krb5_authdata_context_free(context, auth_context->ad_context);
-    free(auth_context);
     k5_memrcache_free(context, auth_context->memrcache);
+    free(auth_context);
     return 0;
 }
 
diff --git a/src/lib/krb5/rcache/t_memrcache.c b/src/lib/krb5/rcache/t_memrcache.c
index a086042..6f212b0 100644
--- a/src/lib/krb5/rcache/t_memrcache.c
+++ b/src/lib/krb5/rcache/t_memrcache.c
@@ -77,5 +77,6 @@ main()
     assert(e != NULL && K5_TAILQ_NEXT(e, links) == NULL);
     k5_memrcache_free(context, mrc);
 
+    krb5_free_context(context);
     return 0;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.