Please help me int this error

I am trying following code for today "Find town judge" probem in LeetCode challenge.
But I am getting "==32==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000078 at pc 0x0000004018c3 bp 0x7ffe71d6b170 sp 0x7ffe71d6b160
WRITE of size 8 at 0x602000000078 thread T0"

Below is my code:

int findJudge(int N, int** trust, int trustSize, int* trustColSize){

 int i,j ,prev,retval;
    
    int suspect;


  int **trustmatrix = (int **)malloc(N+1*sizeof(int*));


   // printf("%x\n",trustmatrix);
   for(i = 0;i<N+1;i++)
    {
        trustmatrix[i] = (int *)malloc(N+1*sizeof(int));
    //   printf("%x\n", trustmatrix[i]);
    }
    
  
   printf("%d  %d\n", trustSize,*trustColSize);
Comments (1)