From c22233a1afcb97e55af2929c7d1416da77d96ca9 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Sat, 26 Oct 2024 15:50:14 +1000 Subject: [PATCH] net: nsos_sockets: free allocated socket on close Free the socket object allocated in `nsos_socket_create` when closing the socket. Signed-off-by: Jordan Yates --- drivers/net/nsos_sockets.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/nsos_sockets.c b/drivers/net/nsos_sockets.c index ac82e1ad525..bfd8cb2c7f3 100644 --- a/drivers/net/nsos_sockets.c +++ b/drivers/net/nsos_sockets.c @@ -256,6 +256,8 @@ static int nsos_close(void *obj) errno = nsos_adapt_get_zephyr_errno(); } + k_free(sock); + return ret; }