diff --git a/opal/mca/dl/dlopen/dl_dlopen_module.c b/opal/mca/dl/dlopen/dl_dlopen_module.c index 104dc41794..192e7af440 100644 --- a/opal/mca/dl/dlopen/dl_dlopen_module.c +++ b/opal/mca/dl/dlopen/dl_dlopen_module.c @@ -3,6 +3,7 @@ * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2016 IBM Corporation. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,7 +33,6 @@ static void do_dlopen(const char *fname, int flags, void **handle, char **err_msg) { - assert(fname); assert(handle); *handle = dlopen(fname, flags); @@ -50,7 +50,6 @@ static void do_dlopen(const char *fname, int flags, static int dlopen_open(const char *fname, bool use_ext, bool private_namespace, opal_dl_handle_t **handle, char **err_msg) { - assert(fname); assert(handle); *handle = NULL; @@ -66,7 +65,7 @@ static int dlopen_open(const char *fname, bool use_ext, bool private_namespace, /* If the caller wants to use filename extensions, loop through them */ void *local_handle = NULL; - if (use_ext) { + if (use_ext && NULL != fname) { int i; char *ext; @@ -109,7 +108,12 @@ static int dlopen_open(const char *fname, bool use_ext, bool private_namespace, (*handle)->dlopen_handle = local_handle; #if OPAL_ENABLE_DEBUG - (*handle)->filename = strdup(fname); + if( NULL != fname ) { + (*handle)->filename = strdup(fname); + } + else { + (*handle)->filename = strdup("(null)"); + } #endif } return (NULL != local_handle) ? OPAL_SUCCESS : OPAL_ERROR; diff --git a/opal/mca/dl/libltdl/dl_libltdl_module.c b/opal/mca/dl/libltdl/dl_libltdl_module.c index ce853ac6c4..4704d00098 100644 --- a/opal/mca/dl/libltdl/dl_libltdl_module.c +++ b/opal/mca/dl/libltdl/dl_libltdl_module.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2016 IBM Corporation. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -18,7 +19,6 @@ static int libltdl_open(const char *fname, bool use_ext, bool private_namespace, opal_dl_handle_t **handle, char **err_msg) { - assert(fname); assert(handle); *handle = NULL; @@ -53,7 +53,12 @@ static int libltdl_open(const char *fname, bool use_ext, bool private_namespace, (*handle)->ltdl_handle = local_handle; #if OPAL_ENABLE_DEBUG - (*handle)->filename = strdup(fname); + if( NULL != fname ) { + (*handle)->filename = strdup(fname); + } + else { + (*handle)->filename = strdup("(null)"); + } #endif return OPAL_SUCCESS;