krb5 commit: Fix minor memory leaks in PKINIT code

Greg Hudson ghudson at MIT.EDU
Thu Jul 5 05:12:47 EDT 2012


https://github.com/krb5/krb5/commit/7f7fa930f7ca9c06b1afaaa453394755dbddb352
commit 7f7fa930f7ca9c06b1afaaa453394755dbddb352
Author: Greg Hudson <ghudson at mit.edu>
Date:   Thu Jul 5 04:52:39 2012 -0400

    Fix minor memory leaks in PKINIT code

 src/plugins/preauth/pkinit/pkinit_crypto_openssl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
index 7120ecf..b8c95e8 100644
--- a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
+++ b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
@@ -3012,6 +3012,7 @@ pkinit_create_sequence_of_principal_identifiers(
     pa_data[1] = NULL;
     pa_data[0] = malloc(sizeof(krb5_pa_data));
     if (pa_data[0] == NULL) {
+        free(pa_data);
         retval = ENOMEM;
         goto cleanup;
     }
@@ -3190,6 +3191,7 @@ pkinit_create_td_dh_parameters(krb5_context context,
     pa_data[1] = NULL;
     pa_data[0] = malloc(sizeof(krb5_pa_data));
     if (pa_data[0] == NULL) {
+        free(pa_data);
         retval = ENOMEM;
         goto cleanup;
     }


More information about the cvs-krb5 mailing list