objstr_t *objstrCreate(unsigned int size)
{
- objstr_t *tmp = malloc(sizeof(objstr_t) + size);
+ objstr_t *tmp = calloc(1, (sizeof(objstr_t) + size));
tmp->size = size;
tmp->next = NULL;
tmp->top = tmp + 1; //points to end of objstr_t structure!
{ //end of list, all full
if (size > DEFAULT_OBJ_STORE_SIZE) //in case of large objects
{
- store->next = (objstr_t *)malloc(sizeof(objstr_t) + size);
+ store->next = (objstr_t *)calloc(1,(sizeof(objstr_t) + size));
if (store->next == NULL)
return NULL;
store = store->next;
}
else
{
- store->next = malloc(sizeof(objstr_t) + DEFAULT_OBJ_STORE_SIZE);
+ store->next = calloc(1,(sizeof(objstr_t) + DEFAULT_OBJ_STORE_SIZE));
if (store->next == NULL)
return NULL;
store = store->next;