does the code properly malloc space for 2d array of struct pixel
struct pixel *pixel_array = malloc(height*width*3);
    if (pixel_array == NULL){
        perror("Unable to malloc space");
        exit(1);
    }
    for(int i = 0; i < height; i++){
        for(int j = 0; j < width; j++){
            if (fseek(image, (pixel_array_offset + 8 * (height * i + j)), SEEK_SET) != 0){
                perror("Unable to navigate in image file");
                exit(1);
            }
            if (fread(&(pixel_array[i][j].blue), sizeof(int), 1, image) != 1){
                perror("Error when reading pixel data");
                exit(1);
            }
            if (fread(&(pixel_array[i][j].green), sizeof(int), 1, image) != 1){
                perror("Error when reading pixel data");
                exit(1);
            }
            if (fread(&(pixel_array[i][j].red), sizeof(int), 1, image) != 1){
                perror("Error when reading pixel data");
                exit(1);
            }
        }
    }
    return pixel_array;