I am currently working on injecting faults and in one of the application I want to replace dynamic part(Malloc) and make it static, So that it is not dependent on kernel instructions. Here is the basic linked list program. How do I replace Malloc instruction and still make liked list to work.
struct test_struct* create_list(int val)
{
printf("\n creating list with headnode as [%d]\n",val);
struct test_struct *ptr = (struct test_struct*)malloc(sizeof(struct test_struct));
if(NULL == ptr1)
{
printf("\n Node creation failed \n");
return NULL;
}
ptr1->val = val;
ptr1->next = NULL;
head = curr = ptr1;
return ptr1;
}