Skip to content
Snippets Groups Projects
Commit a152b303 authored by Simon McVittie's avatar Simon McVittie Committed by Vivek Das Mohapatra
Browse files

capsule_dlmopen: Make sure to copy the error string


*error is to be freed by the caller, but the result of dlerror() is in
static or thread-local storage, so we need to copy it.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 5a8bed09
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
...@@ -183,7 +183,7 @@ static int install_wrappers ( void *dl_handle, ...@@ -183,7 +183,7 @@ static int install_wrappers ( void *dl_handle,
if( dlinfo( dl_handle, RTLD_DI_LINKMAP, &map ) != 0 ) if( dlinfo( dl_handle, RTLD_DI_LINKMAP, &map ) != 0 )
{ {
if( error ) if( error )
*error = dlerror(); *error = strdup( dlerror() );
if( errcode ) if( errcode )
*errcode = EINVAL; *errcode = EINVAL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment