diff options
Diffstat (limited to 'crypto/dso/dso_dl.c')
-rw-r--r-- | crypto/dso/dso_dl.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/dso/dso_dl.c b/crypto/dso/dso_dl.c index af968e3ead..d80bf562c7 100644 --- a/crypto/dso/dso_dl.c +++ b/crypto/dso/dso_dl.c @@ -156,23 +156,21 @@ static char *dl_merger(DSO *dso, const char *filespec1, const char *filespec2) * if the second file specification is missing. */ if (!filespec2 || filespec1[0] == '/') { - merged = OPENSSL_malloc(strlen(filespec1) + 1); + merged = OPENSSL_strdup(filespec1); if (merged == NULL) { DSOerr(DSO_F_DL_MERGER, ERR_R_MALLOC_FAILURE); return (NULL); } - strcpy(merged, filespec1); } /* * If the first file specification is missing, the second one rules. */ else if (!filespec1) { - merged = OPENSSL_malloc(strlen(filespec2) + 1); + merged = OPENSSL_strdup(filespec2); if (merged == NULL) { DSOerr(DSO_F_DL_MERGER, ERR_R_MALLOC_FAILURE); return (NULL); } - strcpy(merged, filespec2); } else /* * This part isn't as trivial as it looks. It assumes that the |