diff options
| author | Elliott Hughes <enh@google.com> | 2013-10-29 20:30:27 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-10-29 20:30:27 +0000 |
| commit | 69920427ea01421d34f3a7576bdd135527b20859 (patch) | |
| tree | cc6a7e56e5c5e74d66603c8170660fd99c52bff3 /core/jni/android_os_Debug.cpp | |
| parent | b4cae4a955ebd91cf35aaeb00ab12ce6f1d5fc48 (diff) | |
| parent | c367d48c55e5a3fa0df14fd62889e4bb6b63cb01 (diff) | |
| download | frameworks_base-69920427ea01421d34f3a7576bdd135527b20859.zip frameworks_base-69920427ea01421d34f3a7576bdd135527b20859.tar.gz frameworks_base-69920427ea01421d34f3a7576bdd135527b20859.tar.bz2 | |
Merge "Fix a variety of small publicly-reported bugs."
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 2883c10..7720389 100644 --- a/core/jni/android_os_Debug.cpp +++ b/core/jni/android_os_Debug.cpp @@ -335,6 +335,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)); @@ -344,13 +345,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) |
