svn rev #23917: trunk/src/lib/gssapi/krb5/
ghudson@MIT.EDU
ghudson at MIT.EDU
Wed Apr 21 19:20:29 EDT 2010
http://src.mit.edu/fisheye/changelog/krb5/?cs=23917
Commit By: ghudson
Log Message:
In the get_credentials() helper of the gss-krb5 init_sec_context code,
ensure that *out_creds is only filled in on successful return.
Changed Files:
U trunk/src/lib/gssapi/krb5/init_sec_context.c
Modified: trunk/src/lib/gssapi/krb5/init_sec_context.c
===================================================================
--- trunk/src/lib/gssapi/krb5/init_sec_context.c 2010-04-21 23:14:49 UTC (rev 23916)
+++ trunk/src/lib/gssapi/krb5/init_sec_context.c 2010-04-21 23:20:29 UTC (rev 23917)
@@ -128,10 +128,12 @@
krb5_creds **out_creds;
{
krb5_error_code code;
- krb5_creds in_creds, evidence_creds;
+ krb5_creds in_creds, evidence_creds, *result_creds = NULL;
krb5_flags flags = 0;
krb5_principal cc_princ = NULL;
+ *out_creds = NULL;
+
k5_mutex_assert_locked(&cred->lock);
memset(&in_creds, 0, sizeof(krb5_creds));
memset(&evidence_creds, 0, sizeof(krb5_creds));
@@ -196,7 +198,7 @@
}
code = krb5_get_credentials(context, flags, cred->ccache,
- &in_creds, out_creds);
+ &in_creds, &result_creds);
if (code)
goto cleanup;
@@ -220,10 +222,14 @@
goto cleanup;
}
+ *out_creds = result_creds;
+ result_creds = NULL;
+
cleanup:
krb5_free_authdata(context, in_creds.authdata);
krb5_free_principal(context, cc_princ);
krb5_free_cred_contents(context, &evidence_creds);
+ krb5_free_creds(context, result_creds);
return code;
}
More information about the cvs-krb5
mailing list