diff options
author | Elena Pourmal <epourmal@hdfgroup.org> | 2003-10-01 16:10:53 (GMT) |
---|---|---|
committer | Elena Pourmal <epourmal@hdfgroup.org> | 2003-10-01 16:10:53 (GMT) |
commit | b6be270f1fc2d8af09b0986e9f792f0af44a4ae6 (patch) | |
tree | e1b892ae629793a60f0dee6d2e2ad43038d0f07b /fortran/src/H5Pf.c | |
parent | 94681179ccdd6e9b04be35ecdceb73aa8972d1e8 (diff) | |
download | hdf5-b6be270f1fc2d8af09b0986e9f792f0af44a4ae6.zip hdf5-b6be270f1fc2d8af09b0986e9f792f0af44a4ae6.tar.gz hdf5-b6be270f1fc2d8af09b0986e9f792f0af44a4ae6.tar.bz2 |
[svn-r7529] Purpose: Code cleanup
Description: On Linux systems valdrind tool complained about memroy leaks in the
following statements like
if(!a) free(a);
Solution: replaced the statements 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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index ea53620..49f8daf 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -1632,7 +1632,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; @@ -1641,6 +1641,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. |