As k5054 has already noted, the file is not read correctly. All values from the file are needed to initialize the grid.
I would also avoid the global variables as far as possible. First of all it would make sense to define an own data type for the grid.
typedef struct {
int rows, cols;
char** map;
Position player, goal;
List history;
} Grid;
Then function calls would be possible without the need for global variables.
void mallocgrid(Grid* grid);
void freegrid(Grid* grid);
int checkPGErr(Grid* grid);
The main program could then look like this:
int row = 0, col = 0, cnt;
char key = -1;
Grid grid;
cnt = fscanf(file, "%d %d", &row, &col);
if (cnt != 2)
{ puts("Error"); return -1; }
grid.rows = row;
grid.cols = col;
grid.player.row = -1;
grid.player.col = -1;
grid.goal.row = 0;
grid.goal.col = 0;
mallocgrid(&grid);
cnt = fscanf(file, "%d %d %c", &row, &col, &key);
if ((cnt != 3) || (key != PLAYER))
{ puts("Error: Player not found!"); return -1; }
else {
grid.player.row = row;
grid.player.col = col;
grid.map[row][col] = PLAYER;
}
cnt = fscanf(file, "%d %d %c", &row, &col, &key);
freegrid(&grid);
return 0;
}