1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-15 22:56:30 +09:00

Fix possible leak in NetUPnP.SOAPRequest.

This commit is contained in:
Marius Ungureanu
2015-09-05 10:36:17 +03:00
parent d8ff2c9d31
commit 30b58c2098

View File

@@ -263,11 +263,12 @@ namespace Lidgren.Network
r.ContentType = "text/xml; charset=\"utf-8\"";
r.ContentLength = b.Length;
r.GetRequestStream().Write(b, 0, b.Length);
XmlDocument resp = new XmlDocument();
WebResponse wres = r.GetResponse();
Stream ress = wres.GetResponseStream();
resp.Load(ress);
return resp;
using (WebResponse wres = r.GetResponse()) {
XmlDocument resp = new XmlDocument();
Stream ress = wres.GetResponseStream();
resp.Load(ress);
return resp;
}
}
}
}