Use m_freem() in error case. Found by Maxime Villard
authorclaudio <claudio@openbsd.org>
Fri, 8 Dec 2017 21:59:05 +0000 (21:59 +0000)
committerclaudio <claudio@openbsd.org>
Fri, 8 Dec 2017 21:59:05 +0000 (21:59 +0000)
OK bluhm@

sys/netmpls/mpls_input.c

index 20c395e..c7b5c0d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: mpls_input.c,v 1.63 2017/12/08 21:56:22 claudio Exp $ */
+/*     $OpenBSD: mpls_input.c,v 1.64 2017/12/08 21:59:05 claudio Exp $ */
 
 /*
  * Copyright (c) 2008 Claudio Jeker <claudio@openbsd.org>
@@ -313,7 +313,7 @@ mpls_ip_adjttl(struct mbuf *m, u_int8_t ttl)
                }
                /* make sure we have a valid header */
                if (in_cksum(m, hlen) != 0) {
-                       m_free(m);
+                       m_freem(m);
                        return NULL;
                }