mirror of
https://github.com/corda/corda.git
synced 2025-03-19 18:45:28 +00:00
Fix potential memory leak in RandomAccessFile#readBytes
This was noticed when copy-editing writeBytes. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
parent
8084cb6398
commit
320fc511dc
@ -889,6 +889,7 @@ Java_java_io_RandomAccessFile_readBytes(JNIEnv* e, jclass, jlong peer,
|
||||
|
||||
DWORD bytesRead = 0;
|
||||
if(!ReadFile(hFile, dst + offset, length, &bytesRead, nullptr)) {
|
||||
e->ReleasePrimitiveArrayCritical(buffer, dst, 0);
|
||||
throwNewErrno(e, "java/io/IOException");
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user