From 4205d685052221255b478f5ac72e03de25e594d2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 30 Jan 2015 09:44:00 -0600 Subject: [PATCH] Networking: Any linger UDP read-ahead buffers must be freed when UDP socket is closed --- net/udp/udp_conn.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/udp/udp_conn.c b/net/udp/udp_conn.c index 3f2106da06..a720043184 100644 --- a/net/udp/udp_conn.c +++ b/net/udp/udp_conn.c @@ -60,6 +60,7 @@ #include "devif/devif.h" #include "netdev/netdev.h" +#include "iob/iob.h" #include "udp/udp.h" /**************************************************************************** @@ -489,6 +490,12 @@ void udp_free(FAR struct udp_conn_s *conn) dq_rem(&conn->node, &g_active_udp_connections); +#ifdef CONFIG_NET_UDP_READAHEAD + /* Release any read-ahead buffers attached to the connection */ + + iob_free_queue(&conn->readahead); +#endif + /* Free the connection */ dq_addlast(&conn->node, &g_free_udp_connections);