fixed small memleak reported by valgrind