public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix memory leak in socket.c
@ 2002-07-15 23:09 Robert Love
  2002-07-16  5:27 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Love @ 2002-07-15 23:09 UTC (permalink / raw)
  To: linux-kernel

This fixes a memory leak in sock_fasync :: net/socket.c.

I sent a fix to Linus and it is now in 2.5.

2.4 and 2.4-ac still require the fix... the following patch applies to
2.4.19-rc1 and 2.4.19-rc1-ac5.

	Robert Love

diff -urN linux-2.4.19-sausage/net/socket.c linux/net/socket.c
--- linux-sausage/net/socket.c	Mon Jun 10 15:26:30 2002
+++ linux/net/socket.c	Mon Jun 10 15:37:48 2002
@@ -743,11 +743,13 @@
 			return -ENOMEM;
 	}
 
-
 	sock = socki_lookup(filp->f_dentry->d_inode);
 	
-	if ((sk=sock->sk) == NULL)
+	if ((sk=sock->sk) == NULL) {
+		if (fna)
+			kfree(fna);
 		return -EINVAL;
+	}
 
 	lock_sock(sk);
 




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fix memory leak in socket.c
  2002-07-15 23:09 [PATCH] fix memory leak in socket.c Robert Love
@ 2002-07-16  5:27 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2002-07-16  5:27 UTC (permalink / raw)
  To: rml; +Cc: linux-kernel


Patch applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-07-16  5:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-15 23:09 [PATCH] fix memory leak in socket.c Robert Love
2002-07-16  5:27 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox