I don't see a matching delete anywhere.
Does it have to be a pointer?