[#2238] Fix bug which caused a SIGSEGV when calling remoteAddress() or localAddress()
This commit is contained in:
parent
5a369e60b1
commit
8f3c09ba6b
@ -132,7 +132,8 @@ jobject createInetSocketAddress(JNIEnv * env, struct sockaddr_storage addr) {
|
||||
port = ntohs(s->sin6_port);
|
||||
inet_ntop(AF_INET6, &s->sin6_addr, ipstr, sizeof ipstr);
|
||||
}
|
||||
jobject socketAddr = (*env)->NewObject(env, inetSocketAddressClass, inetSocketAddrMethodId, ipstr, port);
|
||||
jstring ipString = (*env)->NewStringUTF(env, ipstr);
|
||||
jobject socketAddr = (*env)->NewObject(env, inetSocketAddressClass, inetSocketAddrMethodId, ipString, port);
|
||||
return socketAddr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user