correctly free memory in xsltpost()