summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authormaxv <maxv@NetBSD.org>2018-03-29 17:09:00 +0000
committermaxv <maxv@NetBSD.org>2018-03-29 17:09:00 +0000
commit123bc4debe4a35dba8f7fb4c3cf2e9521987e447 (patch)
tree995d12ea4ddf8af03f87a34620cc9f5e5a654772 /sys
parent4ffb1b7133ec576d5faf8650a339d998c8b5a0c1 (diff)
Fix memory leak, we may reallocate 'tcp_saveti' after 'findpcb'. It's not
a tragic bug, because it happens only on sockets with debug enabled.
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/tcp_input.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index e8368d384a5..6c3ebc135c1 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_input.c,v 1.396 2018/03/29 17:01:46 maxv Exp $ */
+/* $NetBSD: tcp_input.c,v 1.397 2018/03/29 17:09:00 maxv Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.396 2018/03/29 17:01:46 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.397 2018/03/29 17:09:00 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -2348,6 +2348,8 @@ after_listen:
SEQ_GT(th->th_seq, tp->rcv_nxt)) {
tp = tcp_close(tp);
tcp_fields_to_net(th);
+ m_freem(tcp_saveti);
+ tcp_saveti = NULL;
goto findpcb;
}