Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit e90c635

Browse files
committed
Always dispose of WebResponse
1 parent 302a60b commit e90c635

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ServiceStack.Text/HttpUtils.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,11 @@ public static HttpWebResponse GetErrorResponse(this string url)
609609
try
610610
{
611611
var webReq = WebRequest.Create(url);
612-
var webRes = PclExport.Instance.GetResponse(webReq);
613-
var strRes = webRes.ReadToEnd();
614-
return null;
612+
using (var webRes = PclExport.Instance.GetResponse(webReq))
613+
{
614+
var strRes = webRes.ReadToEnd();
615+
return null;
616+
}
615617
}
616618
catch (WebException webEx)
617619
{

0 commit comments

Comments
 (0)