Adding modified test.c file with proper allocs