summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2009-09-09 15:17:09 +0000
committerGreg Hudson <ghudson@mit.edu>2009-09-09 15:17:09 +0000
commitf84d8ab6ec6b5a509844af9874b11ae8a139343b (patch)
treeb7890290c4539599b7ba7d8353953541183a2c59 /src
parent2a7f20f7b92263cb3c67580c4bf40f7bf3deeb5b (diff)
downloadkrb5-f84d8ab6ec6b5a509844af9874b11ae8a139343b.tar.gz
krb5-f84d8ab6ec6b5a509844af9874b11ae8a139343b.tar.xz
krb5-f84d8ab6ec6b5a509844af9874b11ae8a139343b.zip
Fix memory leak in gss_krb5int_copy_ccache
gss_krb5int_copy_ccache was iterating over credentials in a ccache without freeing them. ticket: 6558 tags: pullup target_version: 1.7.1 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22718 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/lib/gssapi/krb5/copy_ccache.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/gssapi/krb5/copy_ccache.c b/src/lib/gssapi/krb5/copy_ccache.c
index e7b48e04f..19fe1d788 100644
--- a/src/lib/gssapi/krb5/copy_ccache.c
+++ b/src/lib/gssapi/krb5/copy_ccache.c
@@ -50,8 +50,11 @@ gss_krb5int_copy_ccache(OM_uint32 *minor_status,
krb5_free_context(context);
return(GSS_S_FAILURE);
}
- while (!code && !krb5_cc_next_cred(context, k5creds->ccache, &cursor, &creds))
+ while (!code && !krb5_cc_next_cred(context, k5creds->ccache, &cursor,
+ &creds)) {
code = krb5_cc_store_cred(context, out_ccache, &creds);
+ krb5_free_cred_contents(context, &creds);
+ }
krb5_cc_end_seq_get(context, k5creds->ccache, &cursor);
k5_mutex_unlock(&k5creds->lock);
*minor_status = code;