Skip to content

Commit

Permalink
Avoid leaking client requests in download().
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Dec 7, 2024
1 parent cb7e386 commit bd0f595
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/vibe/inet/urltransfer.d
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ void download(HTTPClient_ = void*)(URL url, scope void delegate(scope InputStrea
throw new HTTPStatusException(res.statusCode, "Server responded with "~httpStatusText(res.statusCode)~" for "~url.toString());
case HTTPStatus.ok:
done = true;
callback(res.bodyReader.asInterface!InputStream);
auto istr = res.bodyReader.asInterface!InputStream;
scope (exit) destroy(istr);
callback(istr);
break;
case HTTPStatus.movedPermanently:
case HTTPStatus.found:
Expand Down

0 comments on commit bd0f595

Please sign in to comment.