changeset 2011:ae944611249f

6909089: Memory leak occurs by lack of free for read buffer in SocketInputStream#read() Reviewed-by: alanb, jccollet
author chegar
date Thu, 10 Dec 2009 15:52:19 +0000
parents 0f8f624ddcb4
children 59221d9e0c1c
files src/windows/native/java/net/SocketInputStream.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/java/net/SocketInputStream.c	Wed Dec 09 21:09:38 2009 -0800
+++ b/src/windows/native/java/net/SocketInputStream.c	Thu Dec 10 15:52:19 2009 +0000
@@ -121,6 +121,9 @@
             newfd = (*env)->GetIntField(env, fdObj, IO_fd_fdID);
             if (newfd == -1) {
                 NET_ThrowSocketException(env, "Socket Closed");
+                if (bufP != BUF) {
+                    free(bufP);
+                }
                 return -1;
             }
         }