33 * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
44 * Copyright (c) 2015 Los Alamos National Security, LLC. All rights
55 * reserved.
6+ * Copyright (c) 2016 IBM Corporation. All rights reserved.
67 * $COPYRIGHT$
78 *
89 * Additional copyrights may follow
3233static void do_dlopen (const char * fname , int flags ,
3334 void * * handle , char * * err_msg )
3435{
35- assert (fname );
3636 assert (handle );
3737
3838 * handle = dlopen (fname , flags );
@@ -50,7 +50,6 @@ static void do_dlopen(const char *fname, int flags,
5050static int dlopen_open (const char * fname , bool use_ext , bool private_namespace ,
5151 opal_dl_handle_t * * handle , char * * err_msg )
5252{
53- assert (fname );
5453 assert (handle );
5554
5655 * handle = NULL ;
@@ -66,7 +65,7 @@ static int dlopen_open(const char *fname, bool use_ext, bool private_namespace,
6665 /* If the caller wants to use filename extensions, loop through
6766 them */
6867 void * local_handle = NULL ;
69- if (use_ext ) {
68+ if (use_ext && NULL != fname ) {
7069 int i ;
7170 char * ext ;
7271
@@ -109,7 +108,12 @@ static int dlopen_open(const char *fname, bool use_ext, bool private_namespace,
109108 (* handle )-> dlopen_handle = local_handle ;
110109
111110#if OPAL_ENABLE_DEBUG
112- (* handle )-> filename = strdup (fname );
111+ if ( NULL != fname ) {
112+ (* handle )-> filename = strdup (fname );
113+ }
114+ else {
115+ (* handle )-> filename = strdup ("(null)" );
116+ }
113117#endif
114118 }
115119 return (NULL != local_handle ) ? OPAL_SUCCESS : OPAL_ERROR ;
0 commit comments