diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index 021163e8fb..2df1a223fd 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -1480,10 +1480,11 @@ static void* dll_load_library(const char *filename, char *ebuf, int ebuflen) { } return NULL; } + // Load library named // If filename matches .so, and loading fails, repeat with .a. void *os::dll_load(const char *filename, char *ebuf, int ebuflen) { - void* result = nullptr; + void* result = NULL; char* const file_path = strdup(filename); char* const pointer_to_dot = strrchr(file_path, '.'); const char old_extension[] = ".so"; @@ -1493,11 +1494,11 @@ void *os::dll_load(const char *filename, char *ebuf, int ebuflen) { result = dll_load_library(filename, ebuf, ebuflen); // If the load fails,we try to reload by changing the extension to .a for .so files only. // Shared object in .so format dont have braces, hence they get removed for archives with members. - if (result == nullptr && pointer_to_dot != nullptr && strcmp(pointer_to_dot, old_extension) == 0) { + if (result == NULL && pointer_to_dot != NULL && strcmp(pointer_to_dot, old_extension) == 0) { snprintf(pointer_to_dot, sizeof(old_extension), "%s", new_extension); result = dll_load_library(file_path, ebuf, ebuflen); } - FREE_C_HEAP_ARRAY(char, file_path); + FREE_C_HEAP_ARRAY(char, file_path, mtInternal); return result; }