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

Comparing projects/libstatgrab/src/libstatgrab/disk_stats.c (file contents):
Revision 1.63 by tdb, Tue Apr 6 14:52:58 2004 UTC vs.
Revision 1.64 by ats, Wed Apr 7 10:33:50 2004 UTC

# Line 337 | Line 337 | sg_disk_io_stats *sg_get_disk_io_stats(int *entries){
337                  return NULL;
338          }
339  
340 <        disknames = malloc(size);
340 >        disknames = sg_malloc(size);
341          if (disknames == NULL) {
342                  return NULL;
343          }
# Line 346 | Line 346 | sg_disk_io_stats *sg_get_disk_io_stats(int *entries){
346                  return NULL;
347          }
348  
349 <        dk_name = calloc(diskcount, sizeof(char *));
349 >        dk_name = sg_malloc(diskcount * sizeof(char *));
350          bufpp = disknames;
351          for (i = 0; i < diskcount && (name = strsep(&bufpp, ",")) != NULL; i++) {
352                  dk_name[i] = name;
# Line 370 | Line 370 | sg_disk_io_stats *sg_get_disk_io_stats(int *entries){
370          num_disks = size / sizeof(struct diskstats);
371   #endif
372  
373 <        stats = malloc(size);
373 >        stats = sg_malloc(size);
374          if (stats == NULL) {
375                  return NULL;
376          }
# Line 429 | Line 429 | sg_disk_io_stats *sg_get_disk_io_stats(int *entries){
429  
430   #if defined(FREEBSD) || defined(DFBSD)
431          if (!stats_init) {
432 <                stats.dinfo=malloc(sizeof(struct devinfo));
432 >                stats.dinfo=sg_malloc(sizeof(struct devinfo));
433                  if(stats.dinfo==NULL) return NULL;
434                  bzero(stats.dinfo, sizeof(struct devinfo));
435                  stats_init = 1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines