diff options
-rw-r--r-- | sys/netinet/ip_input.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index bee0b86..64e4046 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1574,8 +1574,10 @@ save_rte(m, option, dst) if (ipprintfs) printf("save_rte: olen %d\n", olen); #endif - if (olen > sizeof(opts->ip_srcrt) - (1 + sizeof(dst))) + if (olen > sizeof(opts->ip_srcrt) - (1 + sizeof(dst))) { + m_tag_free((struct m_tag *)opts); return; + } bcopy(option, opts->ip_srcrt.srcopt, olen); opts->ip_nhops = (olen - IPOPT_OFFSET - 1) / sizeof(struct in_addr); opts->ip_srcrt.dst = dst; |