[27581] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit [krb5-1.11]: Fix fd leak in DIR ccache cursor function

daemon@ATHENA.MIT.EDU (Tom Yu)
Thu Feb 21 13:38:37 2013

Date: Thu, 21 Feb 2013 13:38:34 -0500
From: Tom Yu <tlyu@mit.edu>
Message-Id: <201302211838.r1LIcYfI022841@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/c47d02b2f191644eaf352b7e564d927fbd8b12d4
commit c47d02b2f191644eaf352b7e564d927fbd8b12d4
Author: Greg Hudson <ghudson@mit.edu>
Date:   Thu Feb 21 12:36:07 2013 -0500

    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.
    
    (cherry picked from commit c29d5f61af301aa8993b01ed0e3eb4f529d6862c)
    
    ticket: 7573
    version_fixed: 1.11.1
    status: resolved

 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 1c97485..cee21ac 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;
 }
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post