diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-05-26 14:12:02 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-05-26 14:23:12 +0000 |
commit | c8c985136950eee7f6748593d6fdf31eea7f8493 (patch) | |
tree | 3b06861f3c6847b7615c37b14fbe3fe6b6ad61ee | |
parent | fed1474d5adc1117d95b5c68e8ad63f9dfebeb79 (diff) | |
download | apk-tools-c8c985136950eee7f6748593d6fdf31eea7f8493.tar.gz apk-tools-c8c985136950eee7f6748593d6fdf31eea7f8493.tar.bz2 apk-tools-c8c985136950eee7f6748593d6fdf31eea7f8493.tar.xz apk-tools-c8c985136950eee7f6748593d6fdf31eea7f8493.zip |
fetch: fix fd leak
we should always close the in-stream, not only on failure.
-rw-r--r-- | src/fetch.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |