core: fix 2 memleaks