commit bd6278fb28d1d87a58a591244fe1069aa4216a6f Author: Natanael Copa Date: Tue May 26 14:12:02 2009 +0000 fetch: fix fd leak we should always close the in-stream, not only on failure. 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;