9135122 Fix memleaks found by valgrind

Authored and Committed by simo 15 years ago
    Fix memleaks found by valgrind