Fix memleaks in docs2harvest