summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5f90kit.c
diff options
context:
space:
mode:
authorElena Pourmal <epourmal@hdfgroup.org>2003-10-01 16:10:53 (GMT)
committerElena Pourmal <epourmal@hdfgroup.org>2003-10-01 16:10:53 (GMT)
commitb6be270f1fc2d8af09b0986e9f792f0af44a4ae6 (patch)
treee1b892ae629793a60f0dee6d2e2ad43038d0f07b /fortran/src/H5f90kit.c
parent94681179ccdd6e9b04be35ecdceb73aa8972d1e8 (diff)
downloadhdf5-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/H5f90kit.c')
-rw-r--r--fortran/src/H5f90kit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fortran/src/H5f90kit.c b/fortran/src/H5f90kit.c
index 86cb8fc..0f8fed4 100644
--- a/fortran/src/H5f90kit.c
+++ b/fortran/src/H5f90kit.c
@@ -70,7 +70,8 @@ DESCRIPTION
char *
HD5f2cstring(_fcd fdesc, int len)
{
- char *cstr, *str;
+ char *cstr = NULL;
+ char *str;
int i;
str = _fcdtocp(fdesc);
@@ -78,7 +79,7 @@ HD5f2cstring(_fcd fdesc, int len)
for(i=len-1; i>=0 && !isgraph((int)str[i]); i--)
/*EMPTY*/;
cstr = (char *) HDmalloc( (i + 2));
- if (!cstr) return NULL;
+ if (cstr == NULL) return NULL;
cstr[i + 1] = '\0';
HDmemcpy(cstr,str,i+1);
return cstr;