Changeset 5299 for trunk/module-stat.c
- Timestamp:
- 05/26/11 17:32:59 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-stat.c
r5279 r5299 80 80 continue; 81 81 82 stat = malloc(sizeof(READER_STAT)); 83 memset(stat, 0, sizeof(READER_STAT)); 82 if(!cs_malloc(&stat,sizeof(READER_STAT), -1)) continue; 84 83 85 84 //get type by evaluating first line: … … 348 347 READER_STAT *stat = get_stat(rdr, er->caid, prid, er->srvid, er->l); 349 348 if (!stat) { 350 stat = malloc(sizeof(READER_STAT));351 memset(stat, 0, sizeof(READER_STAT));352 stat->caid = er->caid;353 stat->prid = prid;354 stat->srvid = er->srvid;355 stat->ecmlen = er->l;356 stat->time_avg = UNDEF_AVG_TIME; //dummy placeholder357 ll_append(rdr->lb_stat, stat);349 if(cs_malloc(&stat,sizeof(READER_STAT), -1)){ 350 stat->caid = er->caid; 351 stat->prid = prid; 352 stat->srvid = er->srvid; 353 stat->ecmlen = er->l; 354 stat->time_avg = UNDEF_AVG_TIME; //dummy placeholder 355 ll_append(rdr->lb_stat, stat); 356 } 358 357 } 359 358 … … 544 543 545 544 static struct stat_value *crt_cur(struct s_reader *rdr, int32_t value, int32_t time) { 546 struct stat_value *v = malloc(sizeof(struct stat_value)); 545 struct stat_value *v; 546 cs_malloc(&v,sizeof(struct stat_value), 1); 547 547 v->rdr = rdr; 548 548 v->value = value;
Note:
See TracChangeset
for help on using the changeset viewer.