fix memory leak in Java_java_io_File_lastModified (exposed in debug mode)

This commit is contained in:
Joshua Warner 2013-10-17 13:54:59 -06:00
parent 526e3a41a8
commit b3d4f33522

View File

@ -584,8 +584,10 @@ Java_java_io_File_lastModified(JNIEnv* e, jclass, jstring path)
return fileDate.QuadPart / 10000000L;
#else
struct stat fileStat;
if (stat(chars, &fileStat) == -1) {
int res = stat(chars, &fileStat);
releaseChars(e, path, chars);
if (res == -1) {
return 0;
}