Call to build.getEnvironment() should not use null as parameter. This method will attempt to auto-install a JDK if required in order to obtain env vars. At some point, a message tries to be logged and a NPE occurs.

ERROR: Publisher org.jenkinsci.plugins.valgrind.ValgrindPublisher aborted due to exception
java.lang.NullPointerException
	at hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:110)
	at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:61)
	at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:107)
	at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:203)
	at hudson.model.JDK.forNode(JDK.java:122)
	at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:341)
	at hudson.model.Run.getEnvironment(Run.java:2040)
	at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:933)
	at org.jenkinsci.plugins.valgrind.ValgrindPublisher.perform(ValgrindPublisher.java:107)
	at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
	at hudson.model.Build$BuildExecution.post2(Build.java:183)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
	at hudson.model.Run.execute(Run.java:1600)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
	at hudson.model.ResourceController.execute(ResourceController.java:88)
	at hudson.model.Executor.run(Executor.java:241)