libfetch-2.23:

Don't leak file descriptors when iterating local directories or checking
local files for if-modified-since.
This commit is contained in:
joerg 2009-03-10 00:33:38 +00:00
parent bee10725e5
commit a63df80f2c
2 changed files with 6 additions and 3 deletions

View file

@ -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

View file

@ -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;
}