From c8c985136950eee7f6748593d6fdf31eea7f8493 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 26 May 2009 14:12:02 +0000 Subject: fetch: fix fd leak we should always close the in-stream, not only on failure. --- src/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/fetch.c') diff --git a/src/fetch.c b/src/fetch.c index 9e0d930..f3c651b 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -95,10 +95,10 @@ static int fetch_package(struct fetch_ctx *fctx, } r = apk_istream_splice(is, fd, pkg->size, NULL, NULL); + is->close(is); if (fd != STDOUT_FILENO) close(fd); if (r != pkg->size) { - is->close(is); apk_error("Unable to download '%s'", file); unlink(file); return -1; -- cgit v1.2.3-70-g09d2