Skip to content

Commit 1428fca

Browse files
author
Brett Hazen
committed
Close files after making local copies for GiddyUp
1 parent 92fd1e5 commit 1428fca

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/giddyup.erl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,9 @@ post_result(TestPlan, TestResult, #rt_webhook{url=URL, headers=HookHeaders, name
393393
post_artifact(BaseURL, Label, Filename, User, Password) ->
394394
%% First compute the path of where to post the artifact
395395
URL = artifact_url(BaseURL, Label),
396-
{ok, Body} = file:open(Filename, [read, binary]),
397-
ReqBody = make_req_body(Body),
396+
{ok, BodyIoDevice} = file:open(Filename, [read, binary]),
397+
ReqBody = make_req_body(BodyIoDevice),
398+
ok = file:close(BodyIoDevice),
398399
CType = guess_ctype(Label),
399400
BasicAuth = {basic_auth, {User, Password}},
400401

0 commit comments

Comments
 (0)