fix memory leak in Java_java_io_File_length

This commit is contained in:
Joel Dice 2011-01-14 08:13:49 -07:00
parent ff18524906
commit d12d33d716

View File

@ -325,10 +325,10 @@ Java_java_io_File_length(JNIEnv* e, jclass, jstring path)
if (chars) { if (chars) {
STRUCT_STAT s; STRUCT_STAT s;
int r = STAT(chars, &s); int r = STAT(chars, &s);
releaseChars(e, path, chars);
if (r == 0) { if (r == 0) {
return s.st_size; return s.st_size;
} }
releaseChars(e, path, chars);
} }
return -1; return -1;