mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8207753: Handle to process snapshot is leaked if Process32First() fails
Reviewed-by: rriggs
This commit is contained in:
parent
5226a6a2bb
commit
121c59eb6d
1 changed files with 4 additions and 4 deletions
|
@ -198,7 +198,7 @@ Java_java_lang_ProcessHandleImpl_parent0(JNIEnv *env,
|
|||
} else {
|
||||
JNU_ThrowByName(env,
|
||||
"java/lang/RuntimeException", "snapshot not available");
|
||||
return -1;
|
||||
ppid = (DWORD)-1;
|
||||
}
|
||||
CloseHandle(hProcessSnap); // Ignore return code
|
||||
return (jlong)ppid;
|
||||
|
@ -315,7 +315,7 @@ Java_java_lang_ProcessHandleImpl_getProcessPids0(JNIEnv *env,
|
|||
} else {
|
||||
JNU_ThrowByName(env,
|
||||
"java/lang/RuntimeException", "snapshot not available");
|
||||
return 0;
|
||||
count = 0;
|
||||
}
|
||||
CloseHandle(hProcessSnap);
|
||||
// If more pids than array had size for; count will be greater than array size
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue