summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5Ef.c
diff options
context:
space:
mode:
Diffstat (limited to 'fortran/src/H5Ef.c')
-rw-r--r--fortran/src/H5Ef.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fortran/src/H5Ef.c b/fortran/src/H5Ef.c
index de991e3..7b5aea4 100644
--- a/fortran/src/H5Ef.c
+++ b/fortran/src/H5Ef.c
@@ -49,14 +49,17 @@ nh5eprint_c1(_fcd name, int_f* namelen)
int c_namelen;
c_namelen = *namelen;
c_name = (char*)HD5f2cstring(name, c_namelen);
+ if(c_name == NULL) return ret_val;
file = fopen(c_name, "a");
- if(!file) return ret_val;
+ if(!file) { HDfree(c_name);
+ return ret_val;
+ }
/*
* Call H5Eprint function.
*/
status = H5Eprint(file);
fclose(file);
-
+ HDfree(c_name);
if(status < 0) return ret_val;
ret_val = 0;
return ret_val;