diff options
author | Greg Hudson <ghudson@mit.edu> | 2013-02-21 12:36:07 -0500 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2013-02-21 12:36:07 -0500 |
commit | c29d5f61af301aa8993b01ed0e3eb4f529d6862c (patch) | |
tree | 418526c1cf8f5be2358db2c14fdf450af1f61728 | |
parent | c264c4e824e1abe77806e7bf43ab2641459b7ee9 (diff) | |
download | krb5-c29d5f61af301aa8993b01ed0e3eb4f529d6862c.tar.gz krb5-c29d5f61af301aa8993b01ed0e3eb4f529d6862c.tar.xz krb5-c29d5f61af301aa8993b01ed0e3eb4f529d6862c.zip |
Fix fd leak in DIR ccache cursor function
If dcc_ptcursor_next reached the end of a directory, it called free()
on the directory handle instead of closedir(), causing the directory
fd to be leaked. Call closedir() instead.
ticket: 7573
target_version: 1.11.1
tags: pullup
-rw-r--r-- | src/lib/krb5/ccache/cc_dir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/krb5/ccache/cc_dir.c b/src/lib/krb5/ccache/cc_dir.c index 1c97485aca..cee21aca42 100644 --- a/src/lib/krb5/ccache/cc_dir.c +++ b/src/lib/krb5/ccache/cc_dir.c @@ -635,7 +635,7 @@ dcc_ptcursor_next(krb5_context context, krb5_cc_ptcursor cursor, } /* We exhausted the directory without finding a cache to yield. */ - free(data->dir); + closedir(data->dir); data->dir = NULL; return 0; } |