summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5Pf.c
diff options
context:
space:
mode:
authorElena Pourmal <epourmal@hdfgroup.org>2003-10-01 16:13:22 (GMT)
committerElena Pourmal <epourmal@hdfgroup.org>2003-10-01 16:13:22 (GMT)
commit5ecde13413b81978d9f2d54d9ff10c9c2329398e (patch)
treef7f88a6624f60fc3842a2d5c277e0c0391f4438f /fortran/src/H5Pf.c
parent33a96cf91308b9050fb1c27082a12aa500cada87 (diff)
downloadhdf5-5ecde13413b81978d9f2d54d9ff10c9c2329398e.zip
hdf5-5ecde13413b81978d9f2d54d9ff10c9c2329398e.tar.gz
hdf5-5ecde13413b81978d9f2d54d9ff10c9c2329398e.tar.bz2
[svn-r7530] Purpose: Code cleanup
Description: On Linux systems valgrind tool complained about memory leaks in the statements like if(!a) free(a); Solution: Replaced with if(a != NULL) free(a); Platforms tested: eirene (too small for committest) Misc. update:
Diffstat (limited to 'fortran/src/H5Pf.c')
-rw-r--r--fortran/src/H5Pf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c
index fc3f124..50305fd 100644
--- a/fortran/src/H5Pf.c
+++ b/fortran/src/H5Pf.c
@@ -1636,7 +1636,7 @@ nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name,
int c_idx;
herr_t status;
size_t c_namelen;
- char* c_name;
+ char* c_name = NULL;
off_t c_offset;
hsize_t size;
@@ -1645,6 +1645,7 @@ nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name,
* Allocate memory to store the name of the external file.
*/
if(c_namelen) c_name = (char*) HDmalloc(c_namelen + 1);
+ if (c_name == NULL) return ret_value;
/*
* Call H5Pget_external function.