22
delete newVideoSample;
But if the new and delete are in the same context, you're probably better off skipping them and just creating it on the stack instead:
VideoSample newVideoSample = {buf, size};
In that case, no cleanup is necessary.
delete newVideoSample;
However, consider using a smart pointer that will release the memory automatically, for example:
std::auto_ptr<VideoSample> newVideoSample(new VideoSample);
Unless I'm missing something, you just use delete:
delete newVideoSample;