krb5 commit: Fix leaks in KDB test module

ghudson at mit.edu ghudson at mit.edu
Tue May 31 19:53:14 EDT 2022


https://github.com/krb5/krb5/commit/acd384036d41553a3dd2337be8a18dfd089abef7
commit acd384036d41553a3dd2337be8a18dfd089abef7
Author: sashan <anedvedicky at gmail.com>
Date:   Thu May 26 08:47:33 2022 +0200

    Fix leaks in KDB test module

 src/plugins/kdb/test/kdb_test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/plugins/kdb/test/kdb_test.c b/src/plugins/kdb/test/kdb_test.c
index e6d7aae92..f4d4380d5 100644
--- a/src/plugins/kdb/test/kdb_test.c
+++ b/src/plugins/kdb/test/kdb_test.c
@@ -644,7 +644,7 @@ test_issue_pac(krb5_context context, unsigned int flags, krb5_db_entry *client,
 {
     krb5_data data = empty_data();
     krb5_boolean found_logon_info = FALSE;
-    krb5_ui_4 *types;
+    krb5_ui_4 *types = NULL;
     size_t num_buffers = 0, i;
 
     change_auth_indicators(context, auth_indicators);
@@ -692,6 +692,8 @@ test_issue_pac(krb5_context context, unsigned int flags, krb5_db_entry *client,
 
         if (old_pac != NULL)
             assert(found_logon_info);
+
+        free(types);
     }
 
     return 0;
@@ -771,6 +773,7 @@ test_allowed_to_delegate_from(krb5_context context,
     found = match_in_table(context, "rbcd", proxy_princ, server_princ);
     krb5_free_unparsed_name(context, proxy_princ);
     krb5_free_unparsed_name(context, server_princ);
+    krb5_free_unparsed_name(context, client_princ);
     return found ? 0 : KRB5KDC_ERR_BADOPTION;
 }
 


More information about the cvs-krb5 mailing list