From 57295db6c750b6c8d148652b826d3a006f38e6aa Mon Sep 17 00:00:00 2001 From: Peter Cao Date: Mon, 12 Mar 2012 16:53:24 -0500 Subject: [svn-r22054] Use HDmalloc/free. --- tools/lib/h5tools_str.c | 6 +++--- 1 file 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; -- cgit v0.12