summaryrefslogtreecommitdiffstats
path: root/src/H5FDlog.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2011-10-09 08:37:39 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2011-10-09 08:37:39 (GMT)
commit268b9d38192fc46767343ab16cc612ee42f3eabf (patch)
treea6668ca55c8c2780b790c0b9df3edec044a1cb58 /src/H5FDlog.c
parentab4451e2dd2b683e1fa35b3e9a443b065c42b7cb (diff)
downloadhdf5-268b9d38192fc46767343ab16cc612ee42f3eabf.zip
hdf5-268b9d38192fc46767343ab16cc612ee42f3eabf.tar.gz
hdf5-268b9d38192fc46767343ab16cc612ee42f3eabf.tar.bz2
[svn-r21497] Changed H5Pset_fapl_log() to deep copy the log file name instead of copying the pointer.
Tested on jam (simple change).
Diffstat (limited to 'src/H5FDlog.c')
-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);