From 268b9d38192fc46767343ab16cc612ee42f3eabf Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 9 Oct 2011 03:37:39 -0500 Subject: [svn-r21497] Changed H5Pset_fapl_log() to deep copy the log file name instead of copying the pointer. Tested on jam (simple change). --- src/H5FDlog.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- cgit v0.12