diff --git a/src/Runtime/OMExternalConstant.inc b/src/Runtime/OMExternalConstant.inc index 570deb562c..c1b4e5e496 100644 --- a/src/Runtime/OMExternalConstant.inc +++ b/src/Runtime/OMExternalConstant.inc @@ -64,14 +64,11 @@ void omMMapBinaryFile( char *fname = filename; #ifdef __MVS__ // Convert the file name to EBCDIC for the open call. - char *tPath; - size_t tLen = strlen(fname); - tPath = (char *)malloc(tLen); + char *tPath = strdup(fname); if (!tPath) { - fprintf(stderr, "Error while malloc"); + fprintf(stderr, "Error while strdup"); return; } - memcpy(tPath, fname, tLen); __a2e_s(tPath); fname = tPath; #endif