@@ -1480,10 +1480,11 @@ static void* dll_load_library(const char *filename, char *ebuf, int ebuflen) {
1480
1480
}
1481
1481
return NULL ;
1482
1482
}
1483
+
1483
1484
// Load library named <filename>
1484
1485
// If filename matches <name>.so, and loading fails, repeat with <name>.a.
1485
1486
void *os::dll_load (const char *filename, char *ebuf, int ebuflen) {
1486
- void * result = nullptr ;
1487
+ void * result = NULL ;
1487
1488
char * const file_path = strdup (filename);
1488
1489
char * const pointer_to_dot = strrchr (file_path, ' .' );
1489
1490
const char old_extension[] = " .so" ;
@@ -1493,11 +1494,11 @@ void *os::dll_load(const char *filename, char *ebuf, int ebuflen) {
1493
1494
result = dll_load_library (filename, ebuf, ebuflen);
1494
1495
// If the load fails,we try to reload by changing the extension to .a for .so files only.
1495
1496
// 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 ) {
1497
1498
snprintf (pointer_to_dot, sizeof (old_extension), " %s" , new_extension);
1498
1499
result = dll_load_library (file_path, ebuf, ebuflen);
1499
1500
}
1500
- FREE_C_HEAP_ARRAY (char , file_path);
1501
+ FREE_C_HEAP_ARRAY (char , file_path, mtInternal );
1501
1502
return result;
1502
1503
}
1503
1504
0 commit comments