A segementation fault : So I am currently working on this project for school, where I am implementing an algorithm to find a solution for the 'knight game'( it's about finding the shortest way from the top left corner of the board to the bottom right corner), but I've been getting this segmentation fault for three days now, I've checked every pointer I used and everything seems right. 
I implented " searching algorithms, bfs and dfs and ucs, the first two ones work fine, but ucs gives me the segmentation fault, even though they use the same thing except a popBest function. 
Here are some pictures of the ucs and popBest function : 



    Item *popBest( list_t *list ) // and remove the best board from the list.
    {
      assert(list);
      assert(list->numElements);
    
    
      int min_f;
        
      Item *item = list->first;
      Item *best;
      min_f = list->first->f;
      
      while (item) {
        if (item->f < min_f) {
          min_f = item->f;
          best = item;
        }
        item = item->next;
      }
      //item = onList(list, board);
      delList(list, best);
        
      return best;
    }
    
    void ucs(void)
    
    {
        Item *cur_node, *child_p, *temp;
        
        
        while ( listCount(&openList_p) ) { /* While items are on the open list 
            printLt(openList_p );
            /* Get the first item on the open list
            cur_node = popBest(&openList_p);
            //printf("%d  %f\n", listCount(&openList_p), evaluateBoard( cur_node ));
            printBoard(cur_node);
    
      
            addFirst(&closedList_p, cur_node);
            
            if ( evaluateBoard(cur_node) == 0.0 ) {
                showSolution(cur_node);
                printf("\nParcours en largeur (bfs)\n" );
                return;
           }
           else {
                
                
                for (int i = 0; i < MAX_BOARD; i++) {
                    child_p = getChildBoard( cur_node, i );
    
                    if (child_p != NULL) {
                        child_p->f = cur_node->f+1;
                        temp = onList(&openList_p, child_p->board);
                        if (temp ==NULL) addLast( &openList_p, temp);
                        else if (temp != NULL && child_p->f < temp->f )
                        {
                            delList(&openList_p, temp);
                            addLast( &openList_p, temp);
                        }
                      }
                    }
                }
            }
        
        return;
    }
    
    All  the functions work fine for bfs and dfs, the only difference is the popBest function. 
    It would be awesome if someone can guide me as I am still a beginner, thanks in advance. 
    
    PS : sorry for the poor English, I am not a native.

