fixed all memory leaks in ex3 as for VLD