diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2011-10-09 08:37:39 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2011-10-09 08:37:39 (GMT) |
commit | 268b9d38192fc46767343ab16cc612ee42f3eabf (patch) | |
tree | a6668ca55c8c2780b790c0b9df3edec044a1cb58 /src/H5FDlog.c | |
parent | ab4451e2dd2b683e1fa35b3e9a443b065c42b7cb (diff) | |
download | hdf5-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.c | 5 |
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); |