Fixed for newly enforced memory handling convention in the Kerberos
authorTheodore Tso <tytso@mit.edu>
Thu, 13 Jan 1994 23:51:06 +0000 (23:51 +0000)
committerTheodore Tso <tytso@mit.edu>
Thu, 13 Jan 1994 23:51:06 +0000 (23:51 +0000)
library (for the credentials structure).

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

src/lib/gssapi/krb5/init_sec_context.c

index a62a286d6a58d94c44a29457d1e6f33afea0b900..9f3c80d1c36d6771eb57d865cc900a398a27da00 100644 (file)
@@ -72,8 +72,14 @@ make_ap_req(krb5_gss_cred_id_t cred,
    /* fill in the necessary fields in creds */
 
    memset((char *) &creds, 0, sizeof(creds));
-   creds.client = cred->princ;
-   creds.server = server;
+
+   code = krb5_copy_principal(cred->princ, &creds.client);
+   if (code)
+          return code;
+
+   code = krb5_copy_principal(server, &creds.server);
+   if (code)
+          return code;
 
    creds.times.endtime = *endtime;
 
@@ -91,11 +97,6 @@ make_ap_req(krb5_gss_cred_id_t cred,
 
    /* free stuff which was created */
 
-   /* XXXX There's a bug in krb5 here, but I have no clue what it is.
-      This is a workaround. */
-   if (creds.client == cred->princ)
-      creds.client = NULL;
-
    krb5_free_cred_contents(&creds);
 
    /* build up the token */