diff options
author | joerg <joerg@pkgsrc.org> | 2009-03-10 00:33:38 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2009-03-10 00:33:38 +0000 |
commit | a63df80f2cb9495bdc36c5349ca1799075116a61 (patch) | |
tree | a7289369d4607d3c7b4c98750ba7740b1ee4373c /net/libfetch | |
parent | bee10725e57acf8c0c3df8b88c94d519b583e3f1 (diff) | |
download | pkgsrc-a63df80f2cb9495bdc36c5349ca1799075116a61.tar.gz |
libfetch-2.23:
Don't leak file descriptors when iterating local directories or checking
local files for if-modified-since.
Diffstat (limited to 'net/libfetch')
-rw-r--r-- | net/libfetch/Makefile | 4 | ||||
-rw-r--r-- | net/libfetch/files/file.c | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/net/libfetch/Makefile b/net/libfetch/Makefile index 491f1f1d72f..718c14930ac 100644 --- a/net/libfetch/Makefile +++ b/net/libfetch/Makefile @@ -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 --git a/net/libfetch/files/file.c b/net/libfetch/files/file.c index fb858803349..b41255f74b7 100644 --- a/net/libfetch/files/file.c +++ b/net/libfetch/files/file.c @@ -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> @@ -106,6 +106,7 @@ fetchXGetFile(struct url *u, struct url_stat *us, const char *flags) 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 @@ fetchListFile(struct url_list *ue, struct url *u, const char *pattern, const cha fetch_add_entry(ue, u, de->d_name, 0); } + closedir(dir); + return 0; } |