提交 2fdfaba3 编写于 作者: C chegar

6909089: Memory leak occurs by lack of free for read buffer in SocketInputStream#read()

Reviewed-by: alanb, jccollet
上级 e9002d3b
......@@ -121,6 +121,9 @@ Java_java_net_SocketInputStream_socketRead0(JNIEnv *env, jobject this,
newfd = (*env)->GetIntField(env, fdObj, IO_fd_fdID);
if (newfd == -1) {
NET_ThrowSocketException(env, "Socket Closed");
if (bufP != BUF) {
free(bufP);
}
return -1;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册