heapData is a pointer, but I don't see where you point it to valid memory.