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:
Johannes Schindelin 2013-10-21 10:50:37 -05:00
parent 8084cb6398
commit 320fc511dc

View File

@ -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;
}