Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
alpine
apk-tools
Commits
c8c98513
Commit
c8c98513
authored
May 26, 2009
by
Natanael Copa
Browse files
fetch: fix fd leak
we should always close the in-stream, not only on failure.
parent
fed1474d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/fetch.c
View file @
c8c98513
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment