resolves serious bug with memory allocation for large graphs

The calculation of next size was completely wrong. Remember kids, multiply by
sizeof(whatever*) when you're reserving space for whatever pointers.