8177531: libGetNamedModuleTest.c crash when printing NULL-pointer

Fix the NULL-pointer issue

Reviewed-by: stuefe, simonis, sspitsyn
This commit is contained in:
Matthias Baesken 2017-03-25 00:00:13 -07:00
parent 5506a3b126
commit 0e43e94709

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, 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
@ -183,7 +183,7 @@ jvmtiError get_module(JNIEnv *env,
err = (*jvmti)->GetNamedModule(jvmti, loader, pkg_name, module_ptr);
if (err != JVMTI_ERROR_NONE) {
printf(" Error in GetNamedModule for package \"%s\": %s (%d)\n",
pkg_name, TranslateError(err), err);
name, TranslateError(err), err);
return err;
}
printf(" returned module: %p\n", *module_ptr);