* accept_sec_context.c (rd_and_store_for_creds): Handle error
authorTom Yu <tlyu@mit.edu>
Tue, 2 Oct 2001 01:06:36 +0000 (01:06 +0000)
committerTom Yu <tlyu@mit.edu>
Tue, 2 Oct 2001 01:06:36 +0000 (01:06 +0000)
returns from krb5_rd_cred more sanely.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13768 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/krb5/ChangeLog
src/lib/gssapi/krb5/accept_sec_context.c

index 4e5a372a01d1710d37bec5ccd71d6dd03ec5bd20..f036057accb3e133e93803f2d921ffb9d5518d57 100644 (file)
@@ -1,3 +1,8 @@
+2001-10-01  Tom Yu  <tlyu@mit.edu>
+
+       * accept_sec_context.c (rd_and_store_for_creds): Handle error
+       returns from krb5_rd_cred more sanely.
+
 2001-07-27  Danilo Almeida  <dalmeida@mit.edu>
 
        * gssapi_krb5.h: Unmark gss_mech_krb5 variable as an import.
index 55845b903112f3f3e24aca6f9b2066e6b9b28c01..131dffb96f3941d0f13a109dfab3f250eadc6068 100644 (file)
@@ -84,9 +84,9 @@ rd_and_store_for_creds(context, inbuf, out_cred)
     krb5_data *inbuf;
     krb5_gss_cred_id_t *out_cred;
 {
-    krb5_creds ** creds;
+    krb5_creds ** creds = NULL;
     krb5_error_code retval;
-    krb5_ccache ccache;
+    krb5_ccache ccache = NULL;
     krb5_gss_cred_id_t cred = NULL;
     extern krb5_cc_ops krb5_mcc_ops;
     krb5_auth_context auth_context = NULL;
@@ -152,7 +152,8 @@ rd_and_store_for_creds(context, inbuf, out_cred)
        goto cleanup;
     */
 cleanup:
-    krb5_free_tgt_creds(context, creds);
+    if (creds)
+       krb5_free_tgt_creds(context, creds);
 
     if (!cred && ccache)
        (void)krb5_cc_close(context, ccache);