* sendauth.c (krb5_sendauth): Set credspout to NULL if it's
authorTom Yu <tlyu@mit.edu>
Tue, 9 Mar 1999 03:41:29 +0000 (03:41 +0000)
committerTom Yu <tlyu@mit.edu>
Tue, 9 Mar 1999 03:41:29 +0000 (03:41 +0000)
destined to be returned to avoid freeing it.  Also,
unconditionally free credspout if it's non-NULL so that if someone
doesn't pass in a ticket and doesn't give us a non-NULL out_creds,
we don't leak it. [krb5-libs/699]

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

src/lib/krb5/krb/ChangeLog
src/lib/krb5/krb/sendauth.c

index 81d680598b8ff86e1eb1fa9bbcceff8435a92844..b5d517defca10f57c5900f5e7389cf64927d0b6b 100644 (file)
@@ -1,3 +1,11 @@
+Mon Mar  8 22:39:01 1999  Tom Yu  <tlyu@mit.edu>
+
+       * sendauth.c (krb5_sendauth): Set credspout to NULL if it's
+       destined to be returned to avoid freeing it.  Also,
+       unconditionally free credspout if it's non-NULL so that if someone
+       doesn't pass in a ticket and doesn't give us a non-NULL out_creds,
+       we don't leak it. [krb5-libs/699]
+
 1998-11-13  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * Makefile.in: Set the myfulldir and mydir variables (which are
index 348094c7c05f31bdf4a44e397f59980524972869..3436118305653341b58625f9e967359c299bbee1 100644 (file)
@@ -213,12 +213,13 @@ krb5_sendauth(context, auth_context,
        }
        retval = 0;             /* Normal return */
        if (out_creds) {
-               *out_creds = credsp;
+           *out_creds = credsp;
+           credspout = NULL;
        }
 
 error_return:
     krb5_free_cred_contents(context, &creds);
-    if (!out_creds && credspout)
+    if (credspout != NULL)
        krb5_free_creds(context, credspout); 
     if (!ccache && use_ccache)
        krb5_cc_close(context, use_ccache);