summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5FDlog.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index cdcf8ba..d9b379f 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -326,10 +326,13 @@ H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned long long flags, si
FUNC_ENTER_API(H5Pset_fapl_log, FAIL)
H5TRACE4("e", "i*sULz", fapl_id, logfile, flags, buf_size);
+ /* Check arguments */
if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
- fa.logfile = (char *)logfile;
+ /* Deep copy the logfile string */
+ fa.logfile = H5MM_xstrdup(logfile);
+
fa.flags = flags;
fa.buf_size = buf_size;
ret_value = H5P_set_driver(plist, H5FD_LOG, &fa);