krb5 commit: Fix t_s4u2proxy_krb5 cleanup

Greg Hudson ghudson at MIT.EDU
Mon Sep 24 16:58:37 EDT 2012


https://github.com/krb5/krb5/commit/8f795859eb75e855c44a027db2194eac5d282f73
commit 8f795859eb75e855c44a027db2194eac5d282f73
Author: Greg Hudson <ghudson at mit.edu>
Date:   Mon Sep 24 16:57:24 2012 -0400

    Fix t_s4u2proxy_krb5 cleanup
    
    Unlike most GSS test programs, t_s4u2proxy_krb5 uses a cleanup
    handler, so we have to be careful to initialize everything we clean
    up--particularly service2_name, which is initialized after a possible
    goto.  Also, remember to release acceptor_name.

 src/tests/gssapi/t_s4u2proxy_krb5.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/tests/gssapi/t_s4u2proxy_krb5.c b/src/tests/gssapi/t_s4u2proxy_krb5.c
index 4de6ed1..6108715 100644
--- a/src/tests/gssapi/t_s4u2proxy_krb5.c
+++ b/src/tests/gssapi/t_s4u2proxy_krb5.c
@@ -58,7 +58,8 @@ main(int argc, char *argv[])
     gss_buffer_desc buf = GSS_C_EMPTY_BUFFER, token = GSS_C_EMPTY_BUFFER;
     gss_OID mech;
     gss_OID_set mechs;
-    gss_name_t acceptor_name, service1_name, service2_name, client_name;
+    gss_name_t acceptor_name = GSS_C_NO_NAME, client_name = GSS_C_NO_NAME;
+    gss_name_t service1_name = GSS_C_NO_NAME, service2_name = GSS_C_NO_NAME;
     gss_cred_id_t service1_cred = GSS_C_NO_CREDENTIAL;
     gss_cred_id_t deleg_cred = GSS_C_NO_CREDENTIAL;
     gss_ctx_id_t initiator_context = GSS_C_NO_CONTEXT;
@@ -168,6 +169,7 @@ main(int argc, char *argv[])
     (void)gss_release_buffer(&minor, &buf);
 
 cleanup:
+    (void)gss_release_name(&minor, &acceptor_name);
     (void)gss_release_name(&minor, &client_name);
     (void)gss_release_name(&minor, &service1_name);
     (void)gss_release_name(&minor, &service2_name);


More information about the cvs-krb5 mailing list