Fixed valgrind error
(closes #3710)