Compiles perfectly. But when I try to run/debug the program it is giving a segmentation fault(cannot access memory at address 0X04...) while running the line marked in blue. Any suggestions would be greatly appreciated.Code:#include <stdio.h> #include <stdlib.h> struct cachecontents { int bstart; int bcount; struct cachecontents *next; }; typedef struct cache_unit // Cached unit for a given disk { int unitno; struct cachecontents *contents; struct cache_unit *next; } cache; cache *logorgcache[8]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; void cache_insert(int devno, int unitno, int bstart, int bcount) { cache *temp = (cache *)malloc(sizeof(*temp)); cache *curr = (cache *)malloc(sizeof(*curr)); curr->unitno = unitno; curr->contents->bstart = bstart; curr->contents->bcount = bcount; curr->contents->next=NULL; curr->next=NULL; if ((logorgcache[devno] == NULL) || (unitno < logorgcache[devno]->unitno)) // Inserting at Unit Level { curr->next=logorgcache[devno]; logorgcache[devno]=curr; } else { temp = logorgcache[devno]; while ((temp->next) && (unitno >= temp->unitno)) { temp = temp->next; } curr->next = temp->next; temp->next = curr; } } int main() { cache_insert(0,1, 32, 4); return 0; }