From 95b2b777b542295c6643c91392199bbf9c6f2e3c Mon Sep 17 00:00:00 2001 From: Bill Fenner Date: Sat, 18 Mar 2000 08:56:56 +0000 Subject: [PATCH] Make sure to free the socket in soabort() if the protocol couldn't free it (this could happen if the protocol already freed its part and we just kept the socket around to make sure accept(2) didn't block) --- sys/kern/uipc_socket.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 6355dd0e5990..e4433be4a602 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -297,8 +297,14 @@ int soabort(so) struct socket *so; { + int error; - return (*so->so_proto->pr_usrreqs->pru_abort)(so); + error = (*so->so_proto->pr_usrreqs->pru_abort)(so); + if (error) { + sofree(so); + return error; + } + return (0); } int