ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/tools.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/tools.c (file contents):
Revision 1.47 by ats, Wed Apr 7 10:27:53 2004 UTC vs.
Revision 1.48 by ats, Wed Apr 7 10:33:50 2004 UTC

# Line 91 | Line 91 | static void add_mapping(char *bsd, char *svr){
91          mapping_t *map_end_ptr;
92  
93          if (mapping == NULL){
94 <                mapping = malloc(sizeof(mapping_t));
94 >                mapping = sg_malloc(sizeof(mapping_t));
95                  if (mapping == NULL) return;
96                  map_ptr = mapping;
97          }else{
# Line 106 | Line 106 | static void add_mapping(char *bsd, char *svr){
106                  /* We've reached end of list and not found the entry.. So we need to malloc
107                   * new mapping_t
108                   */
109 <                map_end_ptr->next = malloc(sizeof(mapping_t));
109 >                map_end_ptr->next = sg_malloc(sizeof(mapping_t));
110                  if (map_end_ptr->next == NULL) return;
111                  map_ptr = map_end_ptr->next;
112          }
# Line 283 | Line 283 | char *sg_f_read_line(FILE *f, const char *string){
283  
284   char *sg_get_string_match(char *line, regmatch_t *match){
285          int len=match->rm_eo - match->rm_so;
286 <        char *match_string=malloc(len+1);
286 >        char *match_string=sg_malloc(len+1);
287  
288          match_string=strncpy(match_string, line+match->rm_so, len);
289          match_string[len]='\0';
# Line 421 | Line 421 | int sg_update_string(char **dest, const char *src) {
421                  return 0;
422          }
423  
424 <        new = realloc(*dest, strlen(src) + 1);
424 >        new = sg_realloc(*dest, strlen(src) + 1);
425          if (new == NULL) {
426                  return -1;
427          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines