diff --git a/jdk/src/java.instrument/share/native/libinstrument/JPLISAgent.c b/jdk/src/java.instrument/share/native/libinstrument/JPLISAgent.c index 12f2a451e49..fa1341f414b 100644 --- a/jdk/src/java.instrument/share/native/libinstrument/JPLISAgent.c +++ b/jdk/src/java.instrument/share/native/libinstrument/JPLISAgent.c @@ -790,9 +790,10 @@ getModuleObject(jvmtiEnv* jvmti, pkg_name_buf[len] = '\0'; err = (*jvmti)->GetNamedModule(jvmti, loaderObject, pkg_name_buf, &moduleObject); + free((void*)pkg_name_buf); + check_phase_ret_blob(err, NULL); jplis_assert_msg(err == JVMTI_ERROR_NONE, "error in the JVMTI GetNamedModule"); - free((void*)pkg_name_buf); return moduleObject; } diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index f2e96cacf20..04b610714bb 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -134,8 +134,6 @@ java/lang/instrument/RetransformBigClass.sh 8065756 generic- java/lang/instrument/BootClassPath/BootClassPathTest.sh 8072130 macosx-all -java/lang/instrument/DaemonThread/TestDaemonThread.java 8161225 generic-all - java/lang/management/MemoryMXBean/Pending.java 8158837 generic-all java/lang/management/MemoryMXBean/PendingAllGC.sh 8158760 generic-all diff --git a/jdk/test/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java b/jdk/test/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java index 419cfb3bbbd..579db8d6e75 100644 --- a/jdk/test/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java +++ b/jdk/test/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java @@ -1,6 +1,6 @@ /* * Copyright 2014 Goldman Sachs. - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ public class TestDaemonThreadLauncher { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-javaagent:DummyAgent.jar", "TestDaemonThread", "."); OutputAnalyzer analyzer = ProcessTools.executeProcess(pb); analyzer.shouldNotContain("ASSERTION FAILED"); + analyzer.shouldHaveExitValue(0); } } }