fix xml2 memory leak