Fix memory leaks, rename variables so it's more clear they're member variables of the class, remove unnecessary memcpy (already happens above--doing it a second time does nothing, unless there's some other thread overwriting that buffer.  If that's the case, a mutex is the appropriate fix, not copying the buffer repeatedly)