diff --git a/net/udp/udp_conn.c b/net/udp/udp_conn.c index 7ab5e8b153..23e0839a1a 100644 --- a/net/udp/udp_conn.c +++ b/net/udp/udp_conn.c @@ -696,6 +696,10 @@ void udp_free(FAR struct udp_conn_s *conn) #endif + /* Clear the connection structure */ + + memset(conn, 0, sizeof(*conn)); + /* Free the connection */ dq_addlast(&conn->sconn.node, &g_free_udp_connections);