Sample.cpp: Fixed possible memory leak