can't allocate region; abort trap: 6 compiler error : I am reading in a text file. and adding them to a array. I am able to get past the first if statement (category == "Ticket:"). The program doesn't print my statement telling me I'm in the Size category if (category == "Size:"). Im assuming this is where the error is pointing me to. I am passing in a tickets[2] which is declared in main, I need assistance, please :D

    void WaitList::load(Ticket tickets[])
    {
	string a;
	int ticketCount = -1, seatCount;
	//Ticket tickets[2];

	// try to open the waitlist.txt file as input mode
	//inputFile.open("hi.txt");
	ifstream inputFile("hi.txt");



	// cannot open the file
	if (!inputFile.is_open())
		cout << "Cannot open the file.\n";
	// open successfuly
	else
	{
		string category = "", data = "", name = "", flightCode = "";
		int age = 0, seatNumber = 0;
		int c;
		double price = 0;

		inputFile >> category;
		inputFile >> data;
		
		// keep reading till the end of the file
		while (!inputFile.eof())
		{
			if (category == "Ticket:")
			{
				/*
				* Here we increment the index of the ticket in the array.
				* But in our actual Airplane Project we will use LinkedList
				* to store the Tickets, so we will dynamically allocate
				* memory whenever we read the word "Ticket:" in the file.
				* Other than that, the way of reading the file will be the same.
				*/
				c = stoi(data);
				
				
				tickets[++ticketCount].setTicketNum(c);
				seatCount = 0;

				cout << "Finished Ticket catagory"<< endl;
			}

			else if (category == "Size:")
			{
				cout << "Inside Size Catagory";
				c = stoi(data);
				
				
				
				tickets[ticketCount].setgroupSize(c);
				
				tickets[ticketCount].seatInfo = new Seat[tickets[ticketCount].getSize()];
								// allocate space for the seat array;
				 Seat[tickets[ticketCount].groupSize];
			}
			/*else if (category == "Flight:")
			{
				flightCode = data;
			}
			*/
			else if (category == "Name:")
			{
				name = data;


				/*
				* keep reading data for name because it may contain white spaces
				* stop whenever the data is "Age:" (new category)
				*/

				inputFile >> data;
				while (data != "Age:")
				{
					name += " " + data;
					inputFile >> data;

									}

				/*
				* done reading the name
				* set the category to be the current data,
				* then go to the READ_DATA label to read in the new data
				*/
				category = data;
				goto READ_DATA;
			}
			else if (category == "Age:")
				age = stoi(data);
			else if (category == "Seat:")
				seatNumber = stoi(data);
			else if (category == "Price:")
			{
				price = stod(data);

				// fill the seat in the array
				//tickets[ticketCount].seatInfo = new Seat();
				//tickets[ticketCount].seatInfo = new Seat[tickets[ticketCount].getSize()];
				Seat *seat = new Seat(seatNumber, price, new Person(name, age));


				tickets[ticketCount].seatInfo[seatCount].getReserver().setName(name);
				tickets[ticketCount].seatInfo[seatCount].getReserver().setAge(age);
				tickets[ticketCount].getSeat() = seatNumber;
				tickets[ticketCount].getSeat().setPrice(price);
				//tickets[ticketCount].setSeat(seat);
			}

			inputFile >> category;
		READ_DATA:	// label to jump to
			inputFile >> data;
			
		}

		// close the file after finish reading
		inputFile.close();

	}
    }

this is there error when compiling with g++ in mac OS X terminal

    Finished Ticket catagory
    a.out(15552,0x7fff717ae000) malloc: ***
    mach_vm_map(size=10416984889535361024) failed (error code=3)
    *** error: can't allocate region
    *** set a breakpoint in malloc_error_break to debug
    libc++abi.dylib: terminating with uncaught exception of type     std::bad_alloc: std::bad_alloc
    Abort trap: 6

   