aboutsummaryrefslogtreecommitdiff
path: root/RSSDP/HttpResponseParser.cs
diff options
context:
space:
mode:
Diffstat (limited to 'RSSDP/HttpResponseParser.cs')
-rw-r--r--RSSDP/HttpResponseParser.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/RSSDP/HttpResponseParser.cs b/RSSDP/HttpResponseParser.cs
index 0337b3e36..0dd4bb45a 100644
--- a/RSSDP/HttpResponseParser.cs
+++ b/RSSDP/HttpResponseParser.cs
@@ -34,7 +34,9 @@ namespace Rssdp.Infrastructure
catch
{
if (retVal != null)
+ {
retVal.Dispose();
+ }
throw;
}
@@ -77,7 +79,9 @@ namespace Rssdp.Infrastructure
int statusCode = -1;
if (!Int32.TryParse(parts[1].Trim(), out statusCode))
+ {
throw new ArgumentException("data status line is invalid. Status code is not a valid integer.", nameof(data));
+ }
message.StatusCode = (HttpStatusCode)statusCode;