pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/libfetch libfetch-2.23:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6cea347bcb6f
branches:  trunk
changeset: 555823:6cea347bcb6f
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Tue Mar 10 00:33:38 2009 +0000

description:
libfetch-2.23:
Don't leak file descriptors when iterating local directories or checking
local files for if-modified-since.

diffstat:

 net/libfetch/Makefile     |  4 ++--
 net/libfetch/files/file.c |  5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diffs (38 lines):

diff -r c259eb9c1938 -r 6cea347bcb6f net/libfetch/Makefile
--- a/net/libfetch/Makefile     Mon Mar 09 22:57:47 2009 +0000
+++ b/net/libfetch/Makefile     Tue Mar 10 00:33:38 2009 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.25 2009/02/05 22:45:25 joerg Exp $
+# $NetBSD: Makefile,v 1.26 2009/03/10 00:33:38 joerg Exp $
 #
 
-DISTNAME=      libfetch-2.22
+DISTNAME=      libfetch-2.23
 CATEGORIES=    net
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r c259eb9c1938 -r 6cea347bcb6f net/libfetch/files/file.c
--- a/net/libfetch/files/file.c Mon Mar 09 22:57:47 2009 +0000
+++ b/net/libfetch/files/file.c Tue Mar 10 00:33:38 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: file.c,v 1.13 2009/02/05 16:59:45 joerg Exp $  */
+/*     $NetBSD: file.c,v 1.14 2009/03/10 00:33:38 joerg Exp $  */
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
  * Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg%NetBSD.org@localhost>
@@ -106,6 +106,7 @@
 
        if (if_modified_since && u->last_modified > 0 &&
            u->last_modified >= us->mtime) {
+               close(fd);
                fetchLastErrCode = FETCH_UNCHANGED;
                snprintf(fetchLastErrString, MAXERRSTRING, "Unchanged");
                return NULL;
@@ -253,5 +254,7 @@
                fetch_add_entry(ue, u, de->d_name, 0);
        }
 
+       closedir(dir);
+
        return 0;
 }



Home | Main Index | Thread Index | Old Index