return -ENOMEM;
}
- d->ds_names[d->ds_num] = malloc(sizeof(char) * DATA_MAX_NAME_LEN);
+ d->ds_names[d->ds_num] = malloc(DATA_MAX_NAME_LEN);
if(!d->ds_names[d->ds_num])
{
return -ENOMEM;
}
g_daemons = tmp;
- nd = malloc(sizeof(*nd));
+ nd = malloc(sizeof (*nd));
if(!nd)
{
return ENOMEM;
static int add_last(struct ceph_daemon *d, const char *ds_n, double cur_sum,
uint64_t cur_count)
{
- d->last_poll_data[d->last_idx] = malloc(1 * sizeof(struct last_data));
+ d->last_poll_data[d->last_idx] = malloc(sizeof (*d->last_poll_data[d->last_idx]));
if(!d->last_poll_data[d->last_idx])
{
return -ENOMEM;
if(!d->last_poll_data)
{
- d->last_poll_data = malloc(1 * sizeof(struct last_data *));
+ d->last_poll_data = malloc(sizeof (*d->last_poll_data));
if(!d->last_poll_data)
{
return -ENOMEM;