diff options
Diffstat (limited to 'core/jni/android_os_Debug.cpp')
-rw-r--r-- | core/jni/android_os_Debug.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp index 054ee4f..a041693 100644 --- a/core/jni/android_os_Debug.cpp +++ b/core/jni/android_os_Debug.cpp @@ -675,6 +675,7 @@ static jint read_binder_stat(const char* stat) // loop until we have the block that represents this process do { if (fgets(line, 1024, fp) == 0) { + fclose(fp); return -1; } } while (strncmp(compare, line, len)); @@ -684,13 +685,16 @@ static jint read_binder_stat(const char* stat) do { if (fgets(line, 1024, fp) == 0) { + fclose(fp); return -1; } } while (strncmp(compare, line, len)); // we have the line, now increment the line ptr to the value char* ptr = line + len; - return atoi(ptr); + jint result = atoi(ptr); + fclose(fp); + return result; } static jint android_os_Debug_getBinderSentTransactions(JNIEnv *env, jobject clazz) |