Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > ParamHelper
diff ReadParamsFromFile.c @ 19:740df4b46535
new branch -- for universal -- changed malloc and free -- do PR__start before use
| author | Sean Halle <seanhalle@yahoo.com> |
|---|---|
| date | Tue, 23 Jul 2013 07:20:05 -0700 |
| parents | 93b017e30c76 |
| children | 5837ad792168 |
line diff
1.1 --- a/ReadParamsFromFile.c Wed Jun 12 15:51:30 2013 -0700 1.2 +++ b/ReadParamsFromFile.c Tue Jul 23 07:20:05 2013 -0700 1.3 @@ -9,6 +9,7 @@ 1.4 #include <string.h> 1.5 1.6 #include "Param.h" 1.7 +#include "PR__common_includes/Services_offered_by_PR/Memory_Handling/vmalloc__wrapper_library.h" 1.8 1.9 ParamStruc * makeParamFromStrs( char * type, char *value ); 1.10 1.11 @@ -24,7 +25,7 @@ 1.12 if ( lineptr == NULL || n == NULL) return -1; 1.13 if (*lineptr == NULL || *n == 0) 1.14 { *n = 500; //max length of line in a config file 1.15 - *lineptr = (char *) malloc( *n ); 1.16 + *lineptr = (char *) PR__malloc( *n ); 1.17 if (*lineptr == NULL) return -1; 1.18 } 1.19 if( fgets( *lineptr, *n, stream ) ) 1.20 @@ -45,7 +46,7 @@ 1.21 char* paramValue;// = malloc( 500 ); //max of 500 chars in value 1.22 1.23 lineSz = 500; //max length of line in a config file 1.24 - line = (char *) malloc( lineSz ); 1.25 + line = (char *) PR__malloc( lineSz ); 1.26 if( line == NULL ) 1.27 { printf( "\nIn readParamFileIntoBag: no mem for line\n" ); 1.28 return; 1.29 @@ -108,6 +109,6 @@ 1.30 } 1.31 } 1.32 } 1.33 - free( line ); 1.34 + PR__free( line ); 1.35 } 1.36
