@@ -1480,10 +1480,11 @@ static void* dll_load_library(const char *filename, char *ebuf, int ebuflen) {
14801480 }
14811481 return NULL ;
14821482}
1483+
14831484// Load library named <filename>
14841485// If filename matches <name>.so, and loading fails, repeat with <name>.a.
14851486void *os::dll_load (const char *filename, char *ebuf, int ebuflen) {
1486- void * result = nullptr ;
1487+ void * result = NULL ;
14871488 char * const file_path = strdup (filename);
14881489 char * const pointer_to_dot = strrchr (file_path, ' .' );
14891490 const char old_extension[] = " .so" ;
@@ -1493,11 +1494,11 @@ void *os::dll_load(const char *filename, char *ebuf, int ebuflen) {
14931494 result = dll_load_library (filename, ebuf, ebuflen);
14941495 // If the load fails,we try to reload by changing the extension to .a for .so files only.
14951496 // Shared object in .so format dont have braces, hence they get removed for archives with members.
1496- if (result == nullptr && pointer_to_dot != nullptr && strcmp (pointer_to_dot, old_extension) == 0 ) {
1497+ if (result == NULL && pointer_to_dot != NULL && strcmp (pointer_to_dot, old_extension) == 0 ) {
14971498 snprintf (pointer_to_dot, sizeof (old_extension), " %s" , new_extension);
14981499 result = dll_load_library (file_path, ebuf, ebuflen);
14991500 }
1500- FREE_C_HEAP_ARRAY (char , file_path);
1501+ FREE_C_HEAP_ARRAY (char , file_path, mtInternal );
15011502 return result;
15021503}
15031504
0 commit comments