summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools_str.c
diff options
context:
space:
mode:
authorPeter Cao <xcao@hdfgroup.org>2012-03-12 21:53:24 (GMT)
committerPeter Cao <xcao@hdfgroup.org>2012-03-12 21:53:24 (GMT)
commit57295db6c750b6c8d148652b826d3a006f38e6aa (patch)
tree6bc0f90f6e11473443677e01dfa351907314c3ab /tools/lib/h5tools_str.c
parentf698c360f567e9094050b699dfa4721dc1852a68 (diff)
downloadhdf5-57295db6c750b6c8d148652b826d3a006f38e6aa.zip
hdf5-57295db6c750b6c8d148652b826d3a006f38e6aa.tar.gz
hdf5-57295db6c750b6c8d148652b826d3a006f38e6aa.tar.bz2
[svn-r22054] Use HDmalloc/free.
Diffstat (limited to 'tools/lib/h5tools_str.c')
-rw-r--r--tools/lib/h5tools_str.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 795107a..0de126d 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -1395,10 +1395,10 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac
head = newstr;
while ( (tok = strstr ( head, substr ))){
oldstr = newstr;
- newstr = malloc ( strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) + 1 );
+ newstr = HDmalloc ( strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) + 1 );
if ( newstr == NULL ){
- free (oldstr);
+ HDfree (oldstr);
return NULL;
}
memcpy ( newstr, oldstr, tok - oldstr );
@@ -1407,7 +1407,7 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac
memset ( newstr + strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) , 0, 1 );
/* move back head right after the last replacement */
head = newstr + (tok - oldstr) + strlen( replacement );
- free (oldstr);
+ HDfree (oldstr);
}
return newstr;