Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/dist/ipsec-tools/src/racoon Close file handles after ...



details:   https://anonhg.NetBSD.org/src/rev/b043227f66b5
branches:  trunk
changeset: 750878:b043227f66b5
user:      wiz <wiz%NetBSD.org@localhost>
date:      Sun Jan 17 23:02:48 2010 +0000

description:
Close file handles after using them. Found by cppcheck.

diffstat:

 crypto/dist/ipsec-tools/src/racoon/eaytest.c   |  3 ++-
 crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c |  3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 1b6286b64e1c -r b043227f66b5 crypto/dist/ipsec-tools/src/racoon/eaytest.c
--- a/crypto/dist/ipsec-tools/src/racoon/eaytest.c      Sun Jan 17 22:56:32 2010 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/eaytest.c      Sun Jan 17 23:02:48 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eaytest.c,v 1.9 2008/07/15 00:47:09 mgrooms Exp $      */
+/*     $NetBSD: eaytest.c,v 1.10 2010/01/17 23:02:48 wiz Exp $ */
 
 /* Id: eaytest.c,v 1.22 2005/06/19 18:02:54 manubsd Exp */
 
@@ -572,6 +572,7 @@
 
                n++;
        }
+       closedir(dirp);
 
        p = (char **)realloc(certs, (n + 1) * sizeof(certs));
        if (p == NULL)
diff -r 1b6286b64e1c -r b043227f66b5 crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c
--- a/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c    Sun Jan 17 22:56:32 2010 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c    Sun Jan 17 23:02:48 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipsec_doi.c,v 1.43 2009/05/19 09:34:52 tteras Exp $    */
+/*     $NetBSD: ipsec_doi.c,v 1.44 2010/01/17 23:02:48 wiz Exp $       */
 
 /* Id: ipsec_doi.c,v 1.55 2006/08/17 09:20:41 vanhu Exp */
 
@@ -3830,6 +3830,7 @@
                                memcpy(new->v + tlen, b, len);
                                tlen += len;
                        }
+                       fclose(fp);
                        break;
                }
 



Home | Main Index | Thread Index | Old Index