aboutsummaryrefslogtreecommitdiffstats
path: root/dln.c
diff options
context:
space:
mode:
Diffstat (limited to 'dln.c')
-rw-r--r--dln.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dln.c b/dln.c
index f52fc9f021..55f29fda51 100644
--- a/dln.c
+++ b/dln.c
@@ -1250,7 +1250,6 @@ dln_load(const char *file)
#endif
#if !defined(_AIX) && !defined(NeXT)
const char *error = 0;
-#define DLN_ERROR() (error = dln_strerror(), strcpy(ALLOCA_N(char, strlen(error) + 1), error))
#endif
#if defined _WIN32
@@ -1349,7 +1348,8 @@ dln_load(const char *file)
init_fct = (void(*)())(VALUE)dlsym(handle, buf);
if (init_fct == NULL) {
- error = DLN_ERROR();
+ const size_t errlen = strlen(error = dln_strerror()) + 1;
+ error = memcpy(ALLOCA_N(char, errlen), error, errlen);
dlclose(handle);
goto failed;
}