net: ip: icmp: Cleanup packet on failed priority check

A network memory leak would occur if the priority check fails.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
(cherry picked from commit 473cc03c38000696d82b679a0792d329b8441b2d)
diff --git a/subsys/net/ip/icmp.c b/subsys/net/ip/icmp.c
index 97902c1..3228011 100644
--- a/subsys/net/ip/icmp.c
+++ b/subsys/net/ip/icmp.c
@@ -149,7 +149,8 @@
 	    params->priority >= NET_MAX_PRIORITIES) {
 		NET_ERR("Priority %d is too large, maximum allowed is %d",
 			params->priority, NET_MAX_PRIORITIES - 1);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto drop;
 	}
 
 	if (params->priority < 0) {
@@ -269,7 +270,8 @@
 	    params->priority >= NET_MAX_PRIORITIES) {
 		NET_ERR("Priority %d is too large, maximum allowed is %d",
 			params->priority, NET_MAX_PRIORITIES - 1);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto drop;
 	}
 
 	if (params->priority < 0) {