Browse Source

Merge PR #701: src/Cedar/Radius: resolve several coverity "issues"

Davide Beatrici 7 years ago
parent
commit
9a6b871a0e
1 changed files with 3 additions and 10 deletions
  1. 3 10
      src/Cedar/Radius.c

+ 3 - 10
src/Cedar/Radius.c

@@ -1577,7 +1577,7 @@ RADIUS_PACKET *ParseRadiusPacket(void *data, UINT size)
 				goto LABEL_ERROR;
 			}
 
-			if (a.Type == RADIUS_ATTRIBUTE_EAP_MESSAGE && a.DataSize >= 5 && a.DataSize <= 1500)
+			if (a.Type == RADIUS_ATTRIBUTE_EAP_MESSAGE && a.DataSize >= 5)
 			{
 				UINT sz_tmp = Endian16(((EAP_MESSAGE *)a.Data)->Len);
 
@@ -1691,15 +1691,8 @@ RADIUS_PACKET *ParseRadiusPacket(void *data, UINT size)
 
 LABEL_ERROR:
 
-	if (p != NULL)
-	{
-		FreeRadiusPacket(p);
-	}
-
-	if (buf != NULL)
-	{
-		FreeBuf(buf);
-	}
+	FreeRadiusPacket(p);
+	FreeBuf(buf);
 
 	return NULL;
 }