8162524: src/jdk.management/share/native/libmanagement_ext/Flag.c doesn't handle JNI exceptions

Add missed exception check

Reviewed-by: dholmes, hb, dsamersoff
This commit is contained in:
Amit Sapre 2016-08-01 13:53:55 +03:00 committed by Dmitry Samersoff
parent b7eda654ab
commit 496e48d0fb

View File

@ -141,6 +141,13 @@ Java_com_sun_management_internal_Flag_getFlags
// ignore unsupported type
continue;
}
if (valueObj == NULL) {
free(globals);
JNU_ThrowOutOfMemoryError(env, 0);
return 0;
}
switch (globals[i].origin) {
case JMM_VMGLOBAL_ORIGIN_DEFAULT:
origin = default_origin;