return NULL;
}
- if (ptr->call_malloc)
- ret= ptr->call_malloc(ptr, length + 1);
- else
- ret= malloc(length + 1);
+ ret= ptr->call_malloc(ptr, length + 1);
memcpy(ret, buffer, length);
ret[length]= '\0';
return NULL;
}
- if (ptr->call_malloc)
- stats= (memcached_stat_st *)ptr->call_malloc(ptr, sizeof(memcached_stat_st)*(ptr->number_of_hosts));
- else
- stats= (memcached_stat_st *)calloc(1, sizeof(memcached_stat_st)*(ptr->number_of_hosts));
+ stats= ptr->call_calloc(ptr, ptr->number_of_hosts, sizeof(memcached_stat_st));
if (!stats)
{
char **list;
size_t length= sizeof(memcached_stat_keys);
- if (ptr->call_malloc)
- list= (char **)ptr->call_malloc(ptr, length);
- else
- list= (char **)calloc(1, length);
+ list= ptr->call_malloc(ptr, length);
if (!list)
{
return;
}
- if (ptr && ptr->call_free)
+ if (ptr)
ptr->call_free(ptr, stat);
else
free(stat);